install flyway

This commit is contained in:
2025-03-27 04:25:00 +01:00
parent 86086eb949
commit 77be521627
3 changed files with 17 additions and 1 deletions

View File

@@ -1,2 +1 @@
POSTGRES_USER=event-demo
PGADMIN_DEFAULT_EMAIL= PGADMIN_DEFAULT_EMAIL=

View File

@@ -32,8 +32,20 @@ services:
- "traefik.http.routers.redis.rule=Host(`redis.traefik.me`)" - "traefik.http.routers.redis.rule=Host(`redis.traefik.me`)"
- "traefik.http.services.redis.loadbalancer.server.port=8001" - "traefik.http.services.redis.loadbalancer.server.port=8001"
flyway:
image: flyway/flyway
container_name: "flyway"
command: migrate
depends_on:
postgresql:
condition: service_healthy
volumes:
- ../migrations/events:/flyway/sql
- ./flyway.conf:/flyway/conf/flyway.conf
postgresql: postgresql:
image: postgres:17.4 image: postgres:17.4
container_name: "postgresql"
ports: ports:
- "5432:5432" - "5432:5432"
environment: environment:
@@ -51,6 +63,7 @@ services:
pgadmin: pgadmin:
image: dpage/pgadmin4 image: dpage/pgadmin4
container_name: "pgadmin"
environment: environment:
PGADMIN_DEFAULT_EMAIL: $PGADMIN_DEFAULT_EMAIL PGADMIN_DEFAULT_EMAIL: $PGADMIN_DEFAULT_EMAIL
PGADMIN_DEFAULT_PASSWORD_FILE: /run/secrets/pgadmin_password PGADMIN_DEFAULT_PASSWORD_FILE: /run/secrets/pgadmin_password

4
docker/flyway.conf Normal file
View File

@@ -0,0 +1,4 @@
flyway.url=jdbc:postgresql://postgresql:5432/event-demo
flyway.user=event-demo
flyway.password=changeit
flyway.schemas=public