version: "3.8"
services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    image: backend:starter
    container_name: medusa-server-default
    depends_on:
      - postgres
      - redis
    environment:
      DATABASE_URL: postgres://postgres:postgres@postgres:5432/medusa-docker
      REDIS_URL: redis://redis
      NODE_ENV: development
      JWT_SECRET: something
      COOKIE_SECRET: something
      PORT: 9000
    ports:
      - "9000:9000"
    volumes:
      - .:/app/medusa
      - node_modules:/app/medusa/node_modules

  postgres:
    image: postgres:10.4
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: medusa-docker

  redis:
    image: redis
    expose:
      - 6379

volumes:
  node_modules:
