Add initial database migration script to create tables and seed data.
Add Dockerfile and docker-compose.yml for containerizing the Spring Boot application with PostgreSQL
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
services:
|
||||
app:
|
||||
image: 'jambotron'
|
||||
container_name: 'jambotron-container'
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: ./src/Docker/Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- postgres_jambotron
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
|
||||
SPRING_DATASOURCE_USERNAME: admin
|
||||
SPRING_DATASOURCE_PASSWORD: postgrespw
|
||||
SPRING_FLYWAY_LOCATIONS: classpath:db.migration
|
||||
FLYWAY_USER: admin
|
||||
FLYWAY_PASSWORD: postgrespw
|
||||
FLYWAY_SCHEMAS: jambotronDB
|
||||
FLYWAY_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
|
||||
|
||||
# SPRING_DATASOURCE_PASSWORD: /run/secrets/db_password
|
||||
# secrets:
|
||||
# - db_password
|
||||
|
||||
|
||||
postgres_jambotron:
|
||||
image: 'postgres:13-alpine'
|
||||
container_name: 'jambotron-postgres-container'
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: admin
|
||||
POSTGRES_PASSWORD: postgrespw
|
||||
# POSTGRES_PASSWORD: /run/secrets/db_password
|
||||
POSTGRES_DB: jambotronDB
|
||||
# secrets:
|
||||
# - db_password
|
||||
#
|
||||
#secrets:
|
||||
# db_password:
|
||||
# file: db_password.txt
|
||||
Reference in New Issue
Block a user