This is a Docker setup for my Node File Uploads Server.
- Clone this repository
- Edit the
env.jsonc
as needed docker-compose up -d
- Server should be accessible on port 4749
This container takes away almost all the effort required to deploy this uploads server to a device. I personally use this container on my Raspberry Pi.
When starting the container, Docker will automatically pull the lastest Node 16 Docker image to use, as well as cloning the most up-to-date version of the uploads server. Subsequent runs will only call git pull
instead of performing a full clone. Dependencies are automatically installed using Yarn within the container.
The uploads
folder in this directory will be added as a Docker volume and mounted within the container at /usr/uploads
. Compared to a normal hosting setup, this reduces the risks (but does not eliminate) of access to files outside the uploads folder.
The env.jsonc
and auth.json
are linked to the container bi-directionally, meaning that changes to these files will be synced between the host system and the container. Note that modifying the env.jsonc
does require a restart of the container (docker-compose restart
) due to caching.
When you edit your server configuration, you need to restart the Docker container for the changes to take effect.
A simple docker-compose restart
should recreate the container if it's already running.
The uploads server should automatically update when restarted, due to the custom entrypoint file used for the container.
If it doesn't, you can force a rebuild and update with the restart-uncached.sh
script in the repo root.
The default port of 4749
has no significance and can be easily changed.
Do not edit the port in the env.jsonc
! Instead, change the port in the docker-compose.yml
.