This commit is contained in:
Javier Feliz 2025-08-06 16:48:04 -04:00
parent 7e817da01f
commit 3d6fe08681
5 changed files with 82 additions and 5 deletions

View File

@ -5,15 +5,23 @@ RUN apk update && apk add --no-cache \
unzip \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /foundry /data
RUN curl -fsSL https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz \
| tar -xzC /usr/local/bin filebrowser \
&& chmod +x /usr/local/bin/filebrowser
WORKDIR /foundry
RUN mkdir -p /foundry /data /config
COPY ./build/foundry /foundry/
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE 30000
RUN chmod +x /usr/local/bin/entrypoint.sh
ENV FILEBROWSER_USERNAME=admin
EXPOSE 30000 8080
VOLUME [ "/data" ]
VOLUME [ "/foundry" ]
VOLUME [ "/config" ]
CMD ["/foundry/main.mjs", "--port=30000", "--headless", "--noupdate", "--dataPath=/data"]
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

View File

@ -8,6 +8,10 @@ docker-build:
docker build -t foundryvtt:$(FOUNDRY_VERSION) .
run:
docker run -p 30000:30000 foundryvtt:$(FOUNDRY_VERSION)
docker run -p 30000:30000 -p 8080:8080 foundryvtt:$(FOUNDRY_VERSION)
docker-push:
docker tag foundryvtt:$(FOUNDRY_VERSION) gitgud.foo/javif89/foundryvtt-docker:$(FOUNDRY_VERSION)
docker push gitgud.foo/javif89/foundryvtt-docker:$(FOUNDRY_VERSION)
build-run: docker-build run

40
README.md Normal file
View File

@ -0,0 +1,40 @@
# FoundryVTT Dockerized
Docker image to deploy FoundryVTT instances with integrated file browser for data management.
## Services
- **FoundryVTT**: Game server running on port 30000
- **FileBrowser**: Web-based file manager for `/data` directory on port 8080
## Ports
- `30000`: FoundryVTT web interface
- `8080`: FileBrowser web interface
## Volume bindings
- `/foundry`: FoundryVTT application files
- `/data`: Game data and user files (accessible via FileBrowser)
- `/config`: FileBrowser configuration and database
## Environment Variables
- `FILEBROWSER_USERNAME`: FileBrowser login username (default: `admin`)
- `FILEBROWSER_PASSWORD`: FileBrowser login password (default: `password`)
## Usage
```bash
docker run -d \
-p 30000:30000 \
-p 8080:8080 \
-v /your/foundry:/foundry \
-v /your/data:/data \
-v /your/config:/config \
-e FILEBROWSER_USERNAME=myuser \
-e FILEBROWSER_PASSWORD=mypass \
your-image-name
```
Access FoundryVTT at `http://localhost:30000` and FileBrowser at `http://localhost:8080`

25
entrypoint.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
if [ -z "$FILEBROWSER_PASSWORD" ]; then
FILEBROWSER_PASSWORD=$(tr -dc 'A-Za-z0-9!@#$%^&*()_+' < /dev/urandom | head -c 16)
fi
echo "========================================="
echo "FILEBROWSER ADMIN CREDENTIALS"
echo "========================================="
echo "Username: $FILEBROWSER_USERNAME"
echo "Password: $FILEBROWSER_PASSWORD"
echo "========================================="
filebrowser config init --database /config/filebrowser.db
if ! filebrowser users ls --database /config/filebrowser.db | grep -q "^$FILEBROWSER_USERNAME"; then
echo "Creating admin user: $FILEBROWSER_USERNAME"
filebrowser users add $FILEBROWSER_USERNAME $FILEBROWSER_PASSWORD --database /config/filebrowser.db --perm.admin
else
echo "Admin user $FILEBROWSER_USERNAME already exists, skipping creation"
fi
filebrowser --port 8080 --root /data --address 0.0.0.0 --database /config/filebrowser.db &
FILEBROWSER_PID=$!
exec node /foundry/main.mjs --port=30000 --headless --noupdate --dataPath=/data

View File