Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #1169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```