services: api: container_name: mnote-api-application build: context: ./server dockerfile: Dockerfile env_file: ".env" ports: - "8099:8099" depends_on: - mongo networks: - notes_network restart: always nginx: image: nginx:alpine container_name: mnotes-nginx-service ports: - "80:80" volumes: - ./nginx.conf:/etc/nginx/nginx.conf networks: - notes_network depends_on: - api mongo: image: mongo container_name: mnotes-db environment: MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME} MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD} MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE} ports: - '27017:27017' networks: - notes_network volumes: - mongodata:/data/db restart: always networks: notes_network: driver: bridge volumes: mongodata: driver: local