Last active
November 8, 2020 06:12
-
-
Save reckenrode/0eb72e1ad2e74ee2d2fec24289fe83e0 to your computer and use it in GitHub Desktop.
Dockerfile for Foundry VTT
This file contains hidden or 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
# syntax = docker/dockerfile:1.1-experimental | |
FROM alpine:latest AS build | |
ARG FOUNDRY_VERSION | |
RUN apk add --update --no-cache --update curl | |
RUN --mount=type=secret,id=foundry \ | |
curl https://foundryvtt.com -c cookies.txt && \ | |
curl -v https://foundryvtt.com/auth/login/ -b cookies.txt -c cookies.txt \ | |
-H 'Referer: https://foundryvtt.com' \ | |
-d csrfmiddlewaretoken=$(cat cookies.txt | grep csrftoken | cut -d$'\t' -f7) \ | |
-d login_redirect='/' \ | |
-d login_username="$(cat /run/secrets/foundry | cut -d$'\t' -f1)" \ | |
-d login_password="$(cat /run/secrets/foundry | cut -d$'\t' -f2)" && \ | |
curl -b cookies.txt \ | |
-H 'Referer: https://foundryvtt.com' \ | |
-L "https://foundryvtt.com/releases/download?version=${FOUNDRY_VERSION}&platform=linux" \ | |
-o foundryvtt.zip | |
RUN mkdir /foundry && unzip foundryvtt.zip -d /foundry | |
FROM alpine:latest | |
RUN apk add --update --no-cache nodejs-current | |
RUN mkdir -p /opt/foundry /var/db/foundry | |
COPY --from=build /foundry/resources/app /opt/foundry | |
RUN adduser -h /nonexistant -g 'Foundry VTT' -s /sbin/nologin -D -H -u 101001 foundry | |
RUN chown foundry:foundry /var/db/foundry | |
EXPOSE 30000 | |
USER foundry:foundry | |
ENTRYPOINT ["/usr/bin/node", "/opt/foundry/main.js", "--headless", "--noupdate", "--dataPath=/var/db/foundry"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment