Skip to content

Commit

Permalink
Add dockerfile (#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Driver-C authored Nov 25, 2024
1 parent 4e4bf56 commit f5d1cda
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Global ARGs
ARG BUILDER_IMAGE=node:16.20
ARG NGINX_IMAGE=nginx:1.26.1-alpine
ARG WORKSPACE=/workspace
ARG WEB_PATH=/usr/share/nginx/html

# Builder
FROM $BUILDER_IMAGE as builder
ARG WORKSPACE

WORKDIR $WORKSPACE
COPY ./ $WORKSPACE/
RUN npm install \
&& npm run build \
&& rm -rf dist \
&& mkdir dist \
&& cp -r *.html *.ico LICENSE evolve lib font strings wiki dist

# Web server
FROM $NGINX_IMAGE
ARG WORKSPACE
ARG WEB_PATH

COPY --from=builder $WORKSPACE/dist $WEB_PATH
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,14 @@ npm run deploy
# Deploys the game to GitHub Pages on Windows (requires forking)
npm run deploy-win
```

## Docker
If you already have a Docker environment set up and want to run an evolve server using Docker, you can execute the following command to build a Docker image for the evolve server.

```
# Build evolve server image
docker build . -t evolve
# Run evolve server. Default address: http://localhost:8080/
docker run --name evolve -p 8080:80 -d evolve
```

0 comments on commit f5d1cda

Please sign in to comment.