Simplifies deployment by using a prebuilt Docker image for the server. Removes build configuration and related port mappings from the compose file, relying on the image configuration instead. Also adds a compose template file with the original configuration.
33 lines
683 B
YAML
33 lines
683 B
YAML
services:
|
|
server:
|
|
image: docker.registry.computerliebe.org/battleship
|
|
environment:
|
|
DATABASE_URL: postgres://postgres:${DATABASE_PASSWORD}@db:5432/${DATABASE_NAME}
|
|
# ports:
|
|
# - 3000:3000
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
db:
|
|
image: postgres
|
|
restart: always
|
|
user: postgres
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_DB: ${DATABASE_NAME}
|
|
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
|
# ports:
|
|
# - 5432:5432
|
|
# expose:
|
|
# - 5432
|
|
healthcheck:
|
|
test: [ "CMD", "pg_isready" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
volumes:
|
|
db-data:
|
|
|