version: '3' services: redis: image: redis:alpine expose: - 6379 restart: always environment: - REDIS_REPLICATION_MODE=master backend: image: node:alpine restart: always expose: - 3000 volumes: - ./backend/:/home/node/app/backend/ - ./helpers/:/home/node/app/helpers/ working_dir: /home/node/app/backend environment: - NODE_ENV=production command: sh -c 'npm i && nodejs index.mjs' links: - redis depends_on: - redis frontend: image: node:alpine volumes: - ./frontend/:/home/node/app/frontend/ working_dir: /home/node/app/frontend command: sh -c 'npm i --also=dev && npm run build' nginx: image: nginx:alpine restart: always volumes: - ./nginx.conf:/etc/nginx/nginx.conf - ./frontend/dist/:/var/www/html/ ports: - "8080:8080" links: - backend depends_on: - backend