mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 19:04:20 +01:00
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:
parent
3684a0944e
commit
82fcb683ba
6 changed files with 60 additions and 17 deletions
3
wien_talks/wien_talks_server/.env.template
Normal file
3
wien_talks/wien_talks_server/.env.template
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
POSTGRES_USER=postgres
|
||||
POSTGRES_DB=wien_talks
|
||||
POSTGRES_PASSWORD=sergtsop
|
||||
3
wien_talks/wien_talks_server/.gitignore
vendored
3
wien_talks/wien_talks_server/.gitignore
vendored
|
|
@ -14,4 +14,5 @@ config/passwords.yaml
|
|||
# Firebase service account key for Firebase auth
|
||||
config/firebase_service_account_key.json
|
||||
|
||||
.env
|
||||
.env
|
||||
*.env
|
||||
|
|
|
|||
25
wien_talks/wien_talks_server/Makefile
Normal file
25
wien_talks/wien_talks_server/Makefile
Normal 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
|
||||
|
||||
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
16
wien_talks/wien_talks_server/docker-compose.local.yaml
Normal file
16
wien_talks/wien_talks_server/docker-compose.local.yaml
Normal 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:
|
||||
|
|
@ -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:
|
||||
Loading…
Add table
Reference in a new issue