mirror of
https://github.com/OHTU-German-learning-website/OHTU-German-learning-website.git
synced 2026-10-12 19:13:51 +03:00
57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
version: "3.6"
|
|
services:
|
|
db:
|
|
image: docker.io/library/postgres:15
|
|
container_name: gradesa-db
|
|
environment:
|
|
POSTGRES_PASSWORD: password
|
|
volumes:
|
|
- pg-data:/var/lib/postgresql/data/
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 10s
|
|
retries: 20
|
|
command: -p 7742
|
|
|
|
pgtestdb:
|
|
image: docker.io/library/postgres:15
|
|
container_name: gradesa-pgtestdb
|
|
environment:
|
|
POSTGRES_PASSWORD: password
|
|
volumes:
|
|
# Uses a tmpfs volume to make tests extremely fast. The data in test
|
|
# databases is not persisted across restarts, nor does it need to be.
|
|
- type: tmpfs
|
|
target: /var/lib/postgresql/data/
|
|
restart: unless-stopped
|
|
command: >
|
|
sh -c "apt update && apt install -y postgresql-15-rum &&
|
|
echo 'trusted = true' >> /usr/share/postgresql/15/extension/rum.control &&
|
|
/usr/local/bin/docker-entrypoint.sh -p 5432 -c fsync=off -c log_statement=all"
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 10s
|
|
retries: 20
|
|
|
|
node-dev-env:
|
|
image: docker.io/library/node:20-trixie
|
|
container_name: node-dev-env
|
|
environment:
|
|
DB_HOST: gradesa-db
|
|
DB_PORT: 7742
|
|
DB_USER: postgres
|
|
DB_PASSWORD: password
|
|
DB_NAME: postgres
|
|
SESSION_SECRET: secret
|
|
volumes:
|
|
- .:/host:Z
|
|
ports:
|
|
- "3000:3000"
|
|
command: >
|
|
sh -c "apt update && apt install -y wget postgresql-client &&
|
|
wget https://github.com/peterldowns/pgmigrate/releases/download/v0.0.6%2Bcommit.4f90829/pgmigrate-linux-amd64 -O /usr/local/bin/pgmigrate &&
|
|
chmod +x /usr/local/bin/pgmigrate && sleep inf"
|
|
volumes:
|
|
pg-data:
|