forked from laverdet/screeps-steamless-client
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change aims to make it easier to build/deploy the proxy via Docker Compose from a clone of this repo. A .dockerignore file was created to reduce image size and improve the layer cache hit rate. This change also restricts external access to the web proxy port to the host machine by default. To revert to the old behavior, add the following environment variable: ``` SCREEPS_PROXY_HOST=0.0.0.0 ``` I also updated the docs with instructions on how to deploy on a machine that doesn't have Steam installed. `vendor/*.nw` was added to .gitignore/.dockerignore to prevent anybody using this approach from accidentally distributing the Screeps client package.
- Loading branch information
Showing
5 changed files
with
95 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/node_modules | ||
/dist | ||
/vendor/*.nw | ||
.env | ||
|
||
/.git | ||
/.github | ||
/.vscode | ||
/docs | ||
/scripts | ||
/.dockerignore | ||
/.gitignore | ||
/compose.yaml | ||
/Dockerfile | ||
/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/node_modules | ||
/dist | ||
/vendor/*.nw | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
FROM node:20 | ||
RUN rm -rf /app | ||
WORKDIR /app | ||
RUN git clone --branch main --single-branch https://github.com/screepers/steamless-client.git /app | ||
RUN npm install | ||
CMD ["npm", "start", "--", "--package", "/screeps.nw", "--host", "0.0.0.0"] | ||
|
||
WORKDIR /srv/screeps | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN --mount=type=cache,target=/root/.npm \ | ||
npm clean-install --ignore-scripts | ||
|
||
COPY . . | ||
|
||
ENV PATH="${PATH}:/srv/screeps/node_modules/bin" | ||
RUN npm run --ignore-scripts build | ||
|
||
ENTRYPOINT ["npm", "--ignore-scripts"] | ||
# NOTE: This command will not work out of the box. | ||
# screeps.nw is not included in the image, as it is copyrighted. | ||
# See README.md and compose.yaml for more information. | ||
CMD ["start", "--", "--package", "/screeps.nw", "--host", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
name: "screeps-client" | ||
|
||
services: | ||
client: | ||
image: node:20 | ||
command: > | ||
npx screepers-steamless-client | ||
--package /screeps.nw | ||
--host 0.0.0.0 | ||
build: . | ||
volumes: | ||
- ${SCREEPS_NW_PATH:?"SCREEPS_NW_PATH not set"}:/screeps.nw | ||
command: | ||
- "start" | ||
- "--" | ||
- "--package=/screeps.nw" | ||
- "--host=0.0.0.0" | ||
ports: | ||
- 8080:8080 | ||
- "${SCREEPS_PROXY_HOST:-127.0.0.1}:8080:8080/tcp" | ||
restart: unless-stopped |