Skip to content

Commit

Permalink
Update docker compose according to good practices
Browse files Browse the repository at this point in the history
  • Loading branch information
alainbodiguel committed Mar 26, 2024
1 parent 5bff7f9 commit fb1241b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docker/docker-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,34 @@ version: '3'

services:
db:
image: postgres:11-alpine
image: postgres
container_name: db
restart: always
environment:
POSTGRES_USER: ${ARLAS_PERSISTENCE_DB_USER:-pg-user}
POSTGRES_PASSWORD: ${ARLAS_PERSISTENCE_DB_PASSWORD:-iAMs00perSecrEET}
POSTGRES_DB: arlas_persistence
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
expose:
- 5432
volumes:
- ${ARLAS_PERSISTENCE_CREATESQL_FILE:-/opt/app/pgCreateTable.sql}:/docker-entrypoint-initdb.d/createTable.sql:ro
healthcheck:
test: "pg_isready -d arlas_persistence"
interval: 10s
timeout: 3s
retries: 30

arlas-persistence-server:
depends_on:
db:
condition: service_healthy
build:
context: ../..
dockerfile: ${DOCKERFILE:-docker/docker-files/Dockerfile-package-only}
image: gisaia/arlas-persistence-server:${ARLAS_PERSISTENCE_SERVER_VERSION:-latest}
container_name: arlas-persistence-server
restart: always
environment:
- ARLAS_PERSISTENCE_HOST="${ARLAS_PERSISTENCE_HOST:-localhost}"
- ARLAS_PERSISTENCE_PORT="${ARLAS_PERSISTENCE_PORT:-9997}"
Expand All @@ -44,7 +53,7 @@ services:
- ARLAS_PERSISTENCE_HIBERNATE_HBM2DDL="${ARLAS_PERSISTENCE_HIBERNATE_HBM2DDL:-update}"
- GOOGLE_APPLICATION_CREDENTIALS=/opt/app/google-registry.json
ports:
- 19997:9997
- "19997:9997" # !EXPOSE!
volumes:
- ${GOOGLE_APPLICATION_CREDENTIALS:-/tmp}:/opt/app/google-registry.json:ro
- ${ARLAS_PERSISTENCE_LOCAL_FOLDER_HOST:-/tmp/persist/}:${ARLAS_PERSISTENCE_LOCAL_FOLDER:-/tmp/persist/}:rw
Expand Down

0 comments on commit fb1241b

Please sign in to comment.