Install with Docker¶
This page gets the app running in password mode, the simplest setup: the app shows its own login page and email is off. Add a mail server or a reverse proxy login afterwards if you want them.
Before you start¶
- Docker is installed on the machine that will run the app.
- You know the address people will use, for example
https://gifts.example.com, and your reverse proxy (or router) sends that address to port 3000 on this machine. opensslis available to generate a secret (any Linux or macOS machine has it).
1. Get the image¶
A ready-made image for amd64 and arm64 is published to the GitHub Container Registry:
To build it yourself instead, from a checkout of the repository:
The image is based on Node 22 on Alpine Linux, pinned by digest. It installs only production dependencies, with install scripts disabled, runs as the unprivileged node user, and uses tini so docker stop shuts the app down cleanly.
2. Write the settings file¶
Create a file called .env with at least this, or copy .env.example from the repository, which explains every setting:
Fill in both empty values:
ADMIN_PASSWORD: a password of your own, at least 12 characters. This is what organisers type to log in.SESSION_SECRET: at least 32 random characters that sign the login cookie. Generate it withopenssl rand -base64 48and paste the output.
APP_URL must be exactly the address in the browser's address bar, including https:// and any port. It goes into every link, mail and QR code, and form posts from any other address are refused.
Keep .env private
It holds the organiser password and, once you add email, the SMTP login. Do not commit it to a repository or share it.
Every setting is listed in the configuration reference.
3. Start the container¶
What happens¶
- On first start the database is created at
/data/giftdraw.dbinside the volume. - The app listens on port 3000 and logs one
server_listeningline. See the logs withdocker logs giftdraw. - Within about half a minute
docker psshows the container ashealthy. The image's health check callsGET /health, which answers{"ok":true}when the database responds. - Organisers go to
APP_URL/admin, for examplehttps://gifts.example.com/admin, and log in withADMIN_PASSWORD. Then follow Run a gift draw.
If the container stops right away, docker logs giftdraw names the setting that is wrong, for example:
The app refuses to start while ADMIN_PASSWORD or SESSION_SECRET is empty or too short, so a forgotten value never leaves a known password in place.
Your data¶
Everything lives in the volume. Keep it: removing the volume deletes every event, group and wish. To keep a copy, back up the volume.
If you mount a host directory on /data instead of a named volume, it must be writable by uid 1000, the node user in the image:
Stopping¶
docker stop giftdraw lets a mail that is being sent finish first. If the mail server does not answer, the app stops anyway after about 8 seconds, or at once on a second stop signal. A mail cut off that way is sent again after the next start.
Next steps¶
- Behind a reverse proxy, set
TRUSTED_PROXIES, or let the proxy handle the login: see Organiser login. - To send mail, add the
SMTP_settings: see Email.