Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker-compose.yml #167

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
version: '3.8'

x-var:
- &POSTGRES_USER default
- &POSTGRES_PASSWORD default
- &POSTGRES_DATABASE default

services:
database:
container_name: database
Expand All @@ -15,6 +20,23 @@ services:
restart: always
volumes:
- /pgdata
healthcheck:
test: ['CMD', 'pg_isready', '-U', *POSTGRES_USER]

migrations:
image: flyway/flyway:9-alpine
container_name: migrations
command: info migrate info
volumes: ['./migrations/sql:/flyway/sql:ro']
environment:
FLYWAY_URL: jdbc:postgresql://database:5432/postgres
FLYWAY_USER: *POSTGRES_USER
FLYWAY_PASSWORD: *POSTGRES_PASSWORD
FLYWAY_BASELINE_ON_MIGRATE: true
FLYWAY_DEFAULT_SCHEMA: USERS
depends_on:
database:
condition: service_healthy

backend:
container_name: backend
Expand Down Expand Up @@ -73,13 +95,3 @@ services:
- ./frontend:/app:z
- /app/node_modules
working_dir: '/app'

flyway:
container_name: flyway
image: flyway/flyway:latest
command:
['-url=jdbc:postgresql://database:5432/default', '-user=default', '-password=default', 'baseline', 'migrate']
volumes:
- ./backend/db/migrations:/flyway/sql
depends_on:
- database
Loading