This is an experiment to build and publish a SvelteKit app to the GitHub container registry.
- The
Dockerfile
contains build instructions and a label for the image. - There's a workflow action to build and deploy to GitHub Container Registry (GHCR).
Create a docker-compose.yml
:
services:
web:
image: ghcr.io/joshnuss/sk-docker-experiment:latest
ports:
- "3000:3000"
environment:
- DATABASE_URL="postgresql:https://postgres:postgres@localhost:5432/db?schema=public"
db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=db
Build and run:
docker compose up
Then visit: https://localhost:3000
- SvelteKit
Dockerfile
is based on @aradalvand's gist. Modified to supportpnpm
. - Article about publishing Docker images to GitHub's container registry
- @onixus74 for explaining how all this works