Skip to content

Docker Deployment

ScanPick ships with a Docker Compose configuration for easy deployment. The stack includes PostgreSQL 16, the ScanPick API, and an nginx reverse proxy.

Terminal window
git clone https://github.com/timDeHof/scanpick.git
cd scanpick
cp .env.example .env
# Edit .env with your secrets
docker compose up --build

Open http://localhost and log in with worker-001 / 1234.

For production, copy the docker-compose.yml to your server and customize:

services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: scanpick
POSTGRES_USER: scanpick
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- /data/scanpick/pgdata:/var/lib/postgresql/data
restart: always
api:
build:
context: .
dockerfile: src/ScanPick.Api/Dockerfile
environment:
DATABASE_CONNECTION_STRING: "Host=postgres;Database=scanpick;Username=scanpick;Password=${POSTGRES_PASSWORD}"
JWT_SECRET: ${JWT_SECRET}
ASPNETCORE_ENVIRONMENT: Production
depends_on:
- postgres
restart: always
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- /etc/ssl:/etc/ssl
depends_on:
- api
restart: always
.env
POSTGRES_PASSWORD=your-secure-password
JWT_SECRET=your-64-char-jwt-secret

PostgreSQL data is stored in a Docker volume. To back up:

Terminal window
docker compose exec postgres pg_dump -U scanpick scanpick > backup.sql

To restore:

Terminal window
cat backup.sql | docker compose exec -T postgres psql -U scanpick scanpick
Terminal window
git pull
docker compose up --build -d

The API applies database migrations automatically on startup.