Add Dockerfile and docker-compose.yml for containerizing the Spring Boot application with PostgreSQL
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
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 |