# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # \\\\\\\\\\\\\\\\\\\ PRODUCTION ENVIRONMENT \\\\\\\\\\\\\\\\\ # \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ version: '3.5' services: # ------------------------------------------------------------ # Nginx - Webserver # ------------------------------------------------------------ nginx: image: nginx:mainline-alpine restart: unless-stopped container_name: nginx command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" ports: - "80:80" - "443:443" volumes: - ./.docker/nginx/prod:/etc/nginx/conf.d:z - ./.docker/certbot/conf:/etc/letsencrypt:z - ./.docker/certbot/www:/var/www/certbot:z # ------------------------------------------------------------ # CERTBOT - SSL CERTIFICATION # ------------------------------------------------------------ certbot: image: certbot/certbot restart: unless-stopped entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" volumes: - ./.docker/certbot/conf:/etc/letsencrypt:z - ./.docker/certbot/www:/var/www/certbot:z # ------------------------------------------------------------ # Node - Backend # ------------------------------------------------------------ backend: build: context: ./.docker/build/node args: NODE_VERSION: ${BACKEND_NODE_VER}-alpine hostname: backend working_dir: /home/node/app volumes: - ./server:/home/node/app:z command: - sh - -c - npm ci && npm run start:${START_BACKEND_AS} depends_on: - redis - mongo # ------------------------------------------------------------ # Redis - Cache Management # ------------------------------------------------------------ redis: image: redis:${REDIS_SERVER}-alpine hostname: redis # Apply custom arguments to redis startup command: redis-server ${REDIS_ARGS:- } environment: - REDIS_ARGS=${REDIS_ARGS:- } # ------------------------------------------------------------ # MongoDB - Database # ------------------------------------------------------------ mongo: image: mongo:${MONGO_SERVER} hostname: mongo volumes: # Mount MongoDB Data directory - ./.docker/data/mongo:/data/db:z