Skip to content

Commit

Permalink
update Dockerfile with healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 committed Mar 10, 2020
1 parent 6a8ca7a commit 2dc4b92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FROM golang:1.13.8 as server

WORKDIR /code

# environment variable
# Environment variable
ENV GOOS=linux
ENV GARCH=amd64
ENV CGO_ENABLED=0
Expand All @@ -38,14 +38,19 @@ RUN go build -o server
### Server
FROM alpine:3.10

# environment variable
# Environment variable
ENV CONFIG="/config.yaml"
ENV STORAGE_DIRECTORY="/data"

RUN apk add iptables
RUN apk add wireguard-tools
RUN apk add curl

# Copy the final build for the frontend and backend
COPY --from=server /code/server /server
COPY --from=website /code/build /website/build

HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost:8000/ || exit 1

# Command to start the server
CMD /server
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
wg-access-server:
# to build the docker image from the source
# build:
# dockerfile: dockerfile
# dockerfile: Dockerfile
# context: .
image: place1/wg-access-server
container_name: wg-access-server
Expand Down

0 comments on commit 2dc4b92

Please sign in to comment.