Skip to content

Commit

Permalink
Client docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzen authored and chappjc committed Nov 17, 2020
1 parent d7096eb commit 09aab70
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,26 @@ While `dexc` may be run from within the git workspace as described above, the
may be copied into a different folder as long as `site` is in the same directory
as `dexc` (e.g. `/opt/dcrdex/dexc` and `/opt/dcrdex/site`).

### Docker

**Build the docker image**

```
docker build -t user/dcrdex -f client/Dockerfile .
```

**Create docker volume**

```
docker volume create --name=dcrdex_data
```

**Run image**

```
docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/root/.dexc user/dcrdex
```


## DEX Specification

Expand Down
32 changes: 32 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Build the docker image
# $ docker build -t user/dcrdex -f client/Dockerfile .
#
# Create docker volume to store client data
# $ docker volume create --name=dcrdex_data
#
# Run the docker image, mapping web access port.
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/root/.dexc user/dcrdex
#

# frontend build
FROM node:14 AS nodebuilder
WORKDIR /root/dex
COPY . .
WORKDIR /root/dex/client/webserver/site/
RUN npm clean-install
RUN npm run build

# dexc binary build
FROM golang:1.15 AS gobuilder
COPY --from=nodebuilder /root/dex/ /root/dex/
WORKDIR /root/dex/client/cmd/dexc/
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build

# Final image
FROM alpine
WORKDIR /root
COPY --from=gobuilder /root/dex/client/cmd/dexc/dexc ./
COPY --from=gobuilder /root/dex/client/webserver/site ./site
EXPOSE 5758
CMD [ "./dexc", "--webaddr=0.0.0.0:5758" ]

0 comments on commit 09aab70

Please sign in to comment.