https://github.com/tjmt/postgres-flyway
Uses the same Postgres from https://hub.docker.com/_/postgres/
The same variables are valid:
It has Flyway (https://flywaydb.org/) installed and it is migrated at RUN.
So, copy the migration files (ex: ./sql/V1__Initial.sql - https://flywaydb.org/documentation/migrations#naming) to the /flyway/sql directory to auto-migrate at run.
FROM tjmt/postgres-flyway:9.4
COPY ./sql /flyway/sql
version: '3'
services:
sistema-database:
build:
context: .
ports:
- 5432:5432
environment:
POSTGRES_USER: sa
POSTGRES_PASSWORD: P@ssw0rd
POSTGRES_DB: Banco
volumes:
- sistema-database:/var/lib/postgresql/data
labels:
kompose.volume.size: 1Gi
kompose.service.type: nodeport
deploy:
replicas: 1
placement:
constraints:
- node.labels.server == database
volumes:
sistema-database:
Use docker-compose down -v to remove the volume and re-test the script from start/empty.
Content type
Image
Digest
Size
251.9 MB
Last updated
about 8 years ago
docker pull tjmt/postgres-flyway