# Rx3-Docker/PostgreSQL Docker Image #------------------------------------------------------------------------------- name: ${IMG_NAME} services: database: container_name: ${IMG_NAME} hostname: ${IMG_NAME} image: ${IMG_URL} build: context: . args: IMG_NAME: ${IMG_NAME} IMG_NAME_FULL: ${IMG_NAME_FULL} IMG_VERSION: ${IMG_VERSION} IMG_MAINTAINER: ${IMG_MAINTAINER} IMG_FROM_URL: ${IMG_FROM_URL} POSTGRESQL_LIB: ${DATABASE_LIB_DIR} POSTGRESQL_DATA: ${DATABASE_DATA_DIR} POSTGRESQL_PORT: ${DATABASE_PORT_MAIN_INT} POSTSQL_LOG_DIR: ${DATABASE_LOG_POSTSQL_DIR} restart: unless-stopped environment: POSTGRESQL_UID: ${POSTGRESQL_UID} POSTGRESQL_GID: ${POSTGRESQL_GID} POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_POSTGRES_PASSWORD} POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE} POSTGRESQL_USER: ${POSTGRESQL_USER} POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD} healthcheck: test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRESQL_USER} -d ${POSTGRESQL_DATABASE}'"] interval: 10s timeout: 3s retries: 3 volumes: - ./var/lib/pgsql/data:/var/lib/pgsql/data - ./var/log/init:${DATABASE_LOG_INIT_DIR} - ./var/log/supervisor:${DATABASE_LOG_SV_DIR} - ./var/log/postgres:${DATABASE_LOG_POSTGRES_DIR} ports: - "127.0.0.1:${DATABASE_PORT_SV_EXT}:${DATABASE_PORT_SV_INT}" - "127.0.0.1:${DATABASE_PORT_MAIN_EXT}:${DATABASE_PORT_MAIN_INT}"