Skip to content

Commit

Permalink
Merge pull request soyking#9 from soyking/support-docker
Browse files Browse the repository at this point in the history
Support docker
  • Loading branch information
soyking authored Oct 25, 2017
2 parents b66ffb2 + eed3012 commit 9049b3a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
images
static/dist
static/node_modules
Dockerfile
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.8 as backend
RUN mkdir -p /go/src/github.com/soyking/e3w
ADD . /go/src/github.com/soyking/e3w
WORKDIR /go/src/github.com/soyking/e3w
RUN CGO_ENABLED=0 go build

FROM node:8 as frontend
RUN mkdir /app
ADD static /app
WORKDIR /app
RUN npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/mirrors/node \
--userconfig=$HOME/.cnpmrc install && npm run publish

FROM alpine:latest
RUN mkdir -p /app/static/dist /app/conf
COPY --from=backend /go/src/github.com/soyking/e3w/e3w /app
COPY --from=frontend /app/dist /app/static/dist
COPY conf/config.default.ini /app/conf
EXPOSE 8080
WORKDIR /app
CMD ["./e3w"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ etcd v3 Web UI based on [Golang](https://golang.org/) && [React](https://faceboo

supporting hierarchy on etcd v3, based on [e3ch](https://github.com/soyking/e3ch)

## Quick Start

```
git clone https://github.com/soyking/e3w.git
cd e3w
docker-compose up
# open http://localhost:8080
```

Or use docker image by `docker pull soyking/e3w`, more details in `Dockerfile` and `docker-compose.yml`

## Overview

KEY/VALUE
Expand Down Expand Up @@ -57,6 +68,10 @@ ETCDCTL_API=3 etcdctl auth enable
# you could set your username and password in SETTING page
```

4.build image

Install dependencies in 3.b, then run `docker build -t soyking/e3w .`

## Notice

- When you want to add some permissions in directories to a user, the implement of hierarchy in [e3ch](https://github.com/soyking/e3ch) requires you to set a directory's READ permission. For example, if role `roleA` has the permission of directory `dir1/dir2`, then it should have permissions:
Expand Down
2 changes: 1 addition & 1 deletion conf/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ auth=false
[etcd]
root_key=e3w_test
dir_value=
addr=127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379
addr=etcd:2379,etcd:22379,etcd:32379
username=
password=
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
etcd:
image: soyking/etcd-goreman:3.2.7
environment:
- CLIENT_ADDR=etcd
e3w:
image: soyking/e3w:latest
volumes:
- ./conf/config.default.ini:/app/conf/config.default.ini
ports:
- "8080:8080"
depends_on:
- etcd

0 comments on commit 9049b3a

Please sign in to comment.