Strategy/docker-compose.yml

38 lines
1.3 KiB
YAML

services:
# spring-boot-kotlin-app:
# image: 'spring-boot-kotlin-app:latest' # Specifies the Docker image for the Spring Boot application
# build:
# context: . # Specifies the build context, which is the current directory
# container_name: spring-boot-kotlin-app # Names the container 'spring-boot-kotlin-app'
# depends_on:
# - db # Ensures that the 'db' service starts before the 'spring-boot-kotlin-app' service
# environment:
# - SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL}
# - SPRING_DATASOURCE_USERNAME=${POSTGRES_USER}
# - SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD}
# - SPRING_JPA_HIBERNATE_DDL_AUTO=update # Configures Hibernate to update the database schema
# ports:
# - "8456:8456"
# networks:
# - app-network
db:
image: postgres:latest
container_name: db
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data # Mounts a volume to persist PostgreSQL data
ports:
- "5432:5432"
networks:
- app-network
volumes:
postgres_data: # Defines a named volume for PostgreSQL data persistence
networks:
app-network:
driver: bridge