x-environment: &common-env WEBSITES_READONLY: "${READONLY:-0}" services: websites: build: dockerfile: Dockerfile context: . image: websites4 command: foreman start -f Procfile volumes: - .:/app - /var/www/e621-thumbnails:/data/e621-thumbnails - /var/www/oceanic-docs:/data/oceanic-docs tmpfs: - /app/tmp/pids environment: <<: *common-env RAILS_ENV: production depends_on: postgres: condition: service_started redis: condition: service_started labels: - "hostname=websites4.containers.local" tty: true postgres: image: postgres:14-alpine volumes: - db_data:/var/lib/postgresql/data restart: unless-stopped environment: - POSTGRES_USER=websites - POSTGRES_DB=websites - POSTGRES_HOST_AUTH_METHOD=trust healthcheck: interval: 5s timeout: 2s test: pg_isready -U websites hostname: postgres.websites4.containers.local labels: - "hostname=postgres.websites4.containers.local" networks: - default redis: image: redis:alpine command: redis-server --save 10 1 --loglevel warning volumes: - redis_data:/data restart: unless-stopped healthcheck: test: redis-cli ping interval: 10s timeout: 5s hostname: redis.websites4.containers.local labels: - "hostname=redis.websites4.containers.local" networks: - default networks: default: name: websites4 driver: bridge ipam: driver: default config: - subnet: 172.19.3.64/27 volumes: db_data: redis_data: