make: add compose file and make targets for local dev container

Signed-off-by: Max R. Carrara <max@aequito.sh>
This commit is contained in:
Max R. Carrara 2025-08-16 14:45:35 +02:00
parent 3684a0944e
commit 82fcb683ba
6 changed files with 60 additions and 17 deletions

View file

@ -0,0 +1,3 @@
POSTGRES_USER=postgres
POSTGRES_DB=wien_talks
POSTGRES_PASSWORD=sergtsop

View file

@ -15,3 +15,4 @@ config/passwords.yaml
config/firebase_service_account_key.json
.env
*.env

View file

@ -0,0 +1,25 @@
include ../defines.mk
COMPOSE_FILE_LOCAL = docker-compose.local.yaml
COMPOSE_FILE_DEPLOY = docker-compose.deploy.yaml
# Basically the current directory's name, so wien_talks_server
COMPOSE_PROJECT := $(shell basename $(shell pwd))
.env: .env.template
cp -a .env.template .env
.PHONY := local local-stop local-down local-clean
local: .env
docker compose -f $(COMPOSE_FILE_LOCAL) up -d
local-stop:
docker compose -f $(COMPOSE_FILE_LOCAL) stop
local-down:
docker compose -f $(COMPOSE_FILE_LOCAL) down
local-clean: local-down
for VOLUME in $(shell docker compose -f $(COMPOSE_FILE_LOCAL) volumes -q); \
do docker volume rm "$$VOLUME"; done

View file

@ -13,3 +13,17 @@ Then you can start the Serverpod server.
When you are finished, you can shut down Serverpod with `Ctrl-C`, then stop Postgres and Redis.
docker compose stop
## Environments & Passwords
Note that the password used in your environment files (`.env` for local
development and `env.d/postgres.env.template` for deployment) must correspond to
the password in `config/passwords.yaml`.
The `config/passwords.yaml` file must be created manually, for example:
```yaml
development:
database: your-password-here
```

View file

@ -0,0 +1,16 @@
services:
postgres:
image: postgres:16-trixie
container_name: postgres-dev
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- db-local:/var/lib/postgresql/data
restart: unless-stopped
ports:
- "8090:5432"
volumes:
db-local:

View file

@ -1,16 +0,0 @@
services:
# Development services
postgres:
image: pgvector/pgvector:pg16
ports:
- "8090:5432"
environment:
POSTGRES_USER:
POSTGRES_DB:
POSTGRES_PASSWORD:
volumes:
- wien_talks_data:/var/lib/postgresql/data
volumes:
wien_talks_data:
wien_talks_test_data: