docker-compose.yml

Summary

Maintainability
Test Coverage
volumes:
  database_data:
    driver: local
  static_content:
    driver: local
networks:
  default:
    driver: bridge
  external:
    external: true
    name: rnet 
services:
  resto:
    image: jjrom/resto:latest
    restart: unless-stopped
    build:
      context: ./
      dockerfile: ./build/resto/Dockerfile
    networks:
      - default
      - external
    ports:
      - ${RESTO_EXPOSED_PORT:-5252}:80
    env_file:
      - ${ENV_FILE:-config.env}
    environment: 
      ### Set to 0 in production environment to activate opcache
      - RESTO_DEBUG=0
      ### Set to 1 in production environment to activate opcache preloading
      - PHP_OPCACHE_ENABLE_PRELOADING=1
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1/_isLive"]
      interval: 1m
      timeout: 5s
    volumes:
      - static_content:/var/www/static

  restodb:
    image: postgis/postgis:16-master
    restart: unless-stopped
    command: ["postgres", "-c", "config_file=/etc/postgresql.conf"]
    # Upgrade shared_memory for complex queries
    shm_size: '2gb'
    networks:
      - default
      - external
    environment:
      - POSTGRES_PASSWORD=${DATABASE_USER_PASSWORD:-resto}
      - POSTGRES_USER=${DATABASE_USER_NAME:-resto}
      - POSTGRES_DB=${DATABASE_NAME:-resto}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER_NAME:-resto}"]
      interval: 1m
      timeout: 5s
    volumes:
      - database_data:/var/lib/postgresql/data
      - ./postgresql-conf/postgresql.conf:/etc/postgresql.conf