version: '3.7'

services:
  proxy:
    image: nginx:alpine
    container_name: proxy
    ports:
      - '80:80'
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
    restart: 'unless-stopped'
    networks:
      - backend
  server:
    build:
      context: ./
      target: development-build-stage
      dockerfile: Dockerfile
    container_name: server
    ports:
      - '3000:3000'
    volumes:
      - ./:/app
      - /app/node_modules
    restart: 'unless-stopped'
    networks:
      - backend
    links:
      - mysql
    depends_on:
      - mysql
  mysql:
    image: mysql:5.7
    container_name: mysql
    environment:
      MYSQL_ROOT_USER: root
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: test
    ports:
      - '3306:3306'
    networks:
      - backend

networks:
  backend:
    driver: bridge

volumes:
  data:
    driver: local
