├── .github └── workflows │ └── publish-docker.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yaml └── run-server.sh /.github/workflows/publish-docker.yml: -------------------------------------------------------------------------------- 1 | name: Push to Docker Hub 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | tags: 8 | - 'v*' 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Set up QEMU 18 | uses: docker/setup-qemu-action@v3 19 | 20 | - name: Set up Docker Buildx 21 | uses: docker/setup-buildx-action@v3 22 | 23 | - name: Login to Docker Hub 24 | uses: docker/login-action@v3 25 | with: 26 | username: ${{ secrets.DOCKER_USERNAME }} 27 | password: ${{ secrets.DOCKER_PASSWORD }} 28 | 29 | - name: Build and push 30 | uses: docker/build-push-action@v5 31 | with: 32 | context: . 33 | platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x 34 | push: true 35 | tags: direckthit/fvtt-docker:latest 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the zip file 2 | foundryvtt*.zip 3 | 4 | # IDE 5 | .vscode/ 6 | 7 | # Docker Compose 8 | docker-compose.local.yaml -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine 2 | 3 | RUN deluser node && \ 4 | mkdir -p /opt/foundryvtt/resources/app && \ 5 | mkdir /data && \ 6 | mkdir /data/foundryvtt && \ 7 | adduser --disabled-password fvtt && \ 8 | chown fvtt:fvtt /opt/foundryvtt && \ 9 | chown fvtt:fvtt /data/foundryvtt && \ 10 | chmod g+s /opt/foundryvtt && \ 11 | chmod g+s /data/foundryvtt 12 | USER fvtt 13 | 14 | COPY --chown=fvtt run-server.sh /opt/foundryvtt 15 | RUN chmod +x /opt/foundryvtt/run-server.sh 16 | 17 | # Set permissions for the volumes 18 | USER root 19 | RUN chown -R fvtt:fvtt /data/foundryvtt && \ 20 | chown -R fvtt:fvtt /opt/foundryvtt/resources && \ 21 | chmod -R g+s /data/foundryvtt && \ 22 | chmod -R g+s /opt/foundryvtt/resources/app 23 | 24 | USER fvtt 25 | VOLUME /data/foundryvtt 26 | VOLUME /host 27 | VOLUME /opt/foundryvtt/resources/app 28 | EXPOSE 30000 29 | 30 | ENTRYPOINT /opt/foundryvtt/run-server.sh 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Benjamin Price 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Foundry VTT - Docker 2 | 3 | 4 | 5 | ## Foundry VTT - Docker 6 | 7 | This repository hosts the Foundry VTT `Dockerfile` for [direckthit/fvtt-docker](https://hub.docker.com/r/direckthit/fvtt-docker) on Docker Hub. 8 | 9 | > [Foundry VTT](https://foundryvtt.com/) is a virtual tabletop for playing tabletop RPG games such as Dungeons & Dragons 5e. 10 | 11 | I've also included a basic `docker-compose.yaml` file which you can use to get things up and running quickly. 12 | 13 | ### **Note** 14 | At the request of the author of Foundry VTT, the source code for Foundry VTT is not included in this image. 15 | 16 | You will need to manually download the zip file from your Foundry VTT account on the [official Foundry VTT website](https://foundryvtt.com/). 17 | 18 | --- 19 | 20 | ## **Recommended Hosting** 21 | 22 | I recommend you host your server on a dedicated server. They can be quite cheap. 23 | 24 | If you don't have a preferred provider, a $5 Ubuntu server from either of the below options are good considerations. 25 | 26 | ### **Hosting Options** 27 | 28 | #### Linode 29 | A great cheap provider with servers all around the globe. They're one of the older VPS providers still around. 30 | 31 | **This is where I personally choose to host my games** 32 | 33 | [Sign Up](https://www.linode.com/?r=311b3d1469c9a251020a9385437b21266fa076f0) 34 | 35 | A couple promo codes you can try during registration (no guarantees): 36 | 37 | - `OBJECT20` - $20 Credit 38 | - `LINODE10` - $10 Credit 39 | 40 | #### Digital Ocean 41 | Another great cheap provider with servers all around the globe. 42 | 43 | [Sign Up](https://m.do.co/c/879607663421) 44 | 45 | Using the above link should grant you a $100 credit (expires in 60 days). 46 | 47 | --- 48 | 49 | ## **Installation** 50 | 51 | ## Prerequisites 52 | 53 | - [Docker](https://docs.docker.com/engine/install/) 54 | - [Docker Compose](https://docs.docker.com/compose/install/) 55 | 56 | ## Instructions 57 | 58 | ### Step 0 - Install Prerequisites 59 | 60 | ***Ensure you have both Docker and Docker Compose installed by following the directions in the links above.*** 61 | 62 | ### Step 1 - Download the `docker-compose.yaml` file 63 | 64 | Manually download it or use the command below 65 | 66 | ```shell 67 | wget https://raw.githubusercontent.com/BenjaminPrice/fvtt-docker/master/docker-compose.yaml 68 | ``` 69 | 70 | ### Step 2 - Download the Foundry VTT Zip File 71 | 72 | - Navigate to your User Profile page and find your Software Download Links on your license page. 73 | - Download the `Linux` version. 74 | - Save it to the same directory as the `docker-compose.yaml` file from the previous step. 75 | 76 | ### Step 3 - Create your data directory 77 | 78 | This directory is where your games, images, etc will all be stored and persisted when the docker container is restarted. 79 | 80 | Either manually create the directory or use this shell command (linux/mac/WSL only) to create the directory in your user home: 81 | 82 | ```shell 83 | mkdir $HOME/foundryvtt-data/ 84 | ``` 85 | 86 | ### Step 4 - Create your app directory (optional) 87 | 88 | This is where you can place your custom login screen. You only need to perform this step if you want a custom login screen on foundryVTT. 89 | 90 | Either manually create the directory or use this shell command (linux/mac/WSL only) to create the directory in your user home: 91 | 92 | ```shell 93 | mkdir $HOME/foundryvtt-app/ 94 | ``` 95 | 96 | ### Step 5 - Modify the `docker-compose.yaml` file 97 | 98 | #### Set your data directory by modifying this line: 99 | 100 | ```yaml 101 | - /path/to/your/foundry/data/directory:/data/foundryvtt 102 | ``` 103 | 104 | Example: 105 | 106 | ```yaml 107 | - /home/player1/foundryvtt-data:/data/foundryvtt 108 | ``` 109 | 110 | #### Set your download directory (where you saved your zip file) by modifying this line: 111 | 112 | ```yaml 113 | - /path/to/your/foundry/zip/file:/host 114 | ``` 115 | 116 | Example: 117 | 118 | ```yaml 119 | - /home/player1/downloads:/host 120 | ``` 121 | 122 | #### Set your app directory (where the app and login screen resides) by modifying this line: 123 | 124 | ```yaml 125 | - /path/to/your/foundry/app/file:/opt/foundryvtt/resources/app 126 | ``` 127 | 128 | Example: 129 | 130 | ```yaml 131 | - /home/player1/foundryvtt-app:/opt/foundryvtt/resources/app 132 | ``` 133 | 134 | ### Step 6 - Run the server 135 | 136 | ```shell 137 | docker-compose up -d 138 | ``` 139 | 140 | ### Step 7 - Access the server 141 | 142 | Navigate to your server in your webbrowser (by IP address, is recommended) 143 | 144 | `http://127.0.0.1:30000/` 145 | 146 | Replace `127.0.0.1` with your own IP address. 147 | 148 | 149 | ### Step 8 - Customize your login screen 150 | 151 | you can customize your login screen using a fix such as this one: 152 | [prettier login screen](https://github.com/TheEpicSnowWolf/Foundry-VTT-Prettier-Login-Screen) 153 | 154 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | foundryvtt: 4 | image: direckthit/fvtt-docker:latest 5 | container_name: fvtt 6 | ports: 7 | - 30000:30000 8 | volumes: 9 | - /path/to/your/foundry/data/directory:/data/foundryvtt 10 | - /path/to/your/foundry/zip/file:/host 11 | - /path/to/your/foundry/app/file:/opt/foundryvtt/resources/app 12 | restart: unless-stopped 13 | -------------------------------------------------------------------------------- /run-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # look for a file name foundryvtt-.....zip or FoundryVTT...zip, copy it to 4 | # /opt/foundryvtt, unzip and remove it. Then start the foundry app 5 | 6 | cd /opt/foundryvtt || exit 7 | echo "Copying zip file..." 8 | find /host -type f -name '[f,F]oundry[vtt,VTT]*.zip' -exec cp '{}' . ';' 9 | 10 | echo "Unzipping..." 11 | unzip -o ./*.zip -d unpacked && rm ./*.zip 12 | 13 | echo "Moving to mapped directory" 14 | mv unpacked/* resources/app/ 15 | 16 | echo "Starting node" 17 | cd resources/app 18 | node main.mjs --dataPath=/data/foundryvtt --------------------------------------------------------------------------------