Skip to content
Snippets Groups Projects
docker-compose.yml 2.56 KiB
Newer Older
version: "3.9"
Matt Kirby's avatar
Matt Kirby committed
services:
  api-gateway:
    restart: always
    image: nginx:latest
    container_name: api-gateway
    volumes:
        - "./nginx/default.conf:/etc/nginx/conf.d/default.conf"
    ports:
        - "8080:80"

  feed-service:
Matt Kirby's avatar
Matt Kirby committed
    build:
      context: "./backend-services/feed-service"
      dockerfile: Dockerfile
    restart: unless-stopped
Matt Kirby's avatar
Matt Kirby committed
    ports:
    environment:
Matt Kirby's avatar
Matt Kirby committed
      - MONGO_URI=mongodb://feed-mongo:27017/
      - JWT_PRIVATE_KEY=yB/uX5KdyjHN9P34IE49HxAcrlQ4gfvpVJEzGbo5E/I=
      - FRIEND_SERVICE_URI=http://friend-service:9000/
      - ENABLE_QUESTION_DB_SEEDING=true
Matt Kirby's avatar
Matt Kirby committed
  user-service:
    build:
Matt Kirby's avatar
Matt Kirby committed
      context: "./backend-services/user-service"
Matt Kirby's avatar
Matt Kirby committed
      dockerfile: Dockerfile
    restart: unless-stopped
    ports:
Matt Kirby's avatar
Matt Kirby committed
    environment:
Matt Kirby's avatar
Matt Kirby committed
      - MONGO_URI=mongodb://user-mongo:27017/userdb
      - JWT_PRIVATE_KEY=yB/uX5KdyjHN9P34IE49HxAcrlQ4gfvpVJEzGbo5E/I=
      - ENABLE_USER_DB_SEEDING=true

  friend-service:
Matt Kirby's avatar
Matt Kirby committed
      context: "./backend-services/friend-service"
      dockerfile: Dockerfile
    restart: unless-stopped
    ports:
Matt Kirby's avatar
Matt Kirby committed
    environment:
Matt Kirby's avatar
Matt Kirby committed
      - MONGO_HOST=friend-mongo
      - MONGO_PORT=27017
      - MONGO_DBNAME=friends
      - JWT_PRIVATE_KEY=yB/uX5KdyjHN9P34IE49HxAcrlQ4gfvpVJEzGbo5E/I=
Matt Kirby's avatar
Matt Kirby committed
  comment-service:
    build:
      context: "./backend-services/comment-service-2"
      dockerfile: Dockerfile
    restart: unless-stopped
    ports:
Matt Kirby's avatar
Matt Kirby committed
    environment:
      - MONGO_HOST=comment-mongo
      - MONGO_PORT=27017
      - MONGO_DBNAME=comments
      - JWT_PRIVATE_KEY=yB/uX5KdyjHN9P34IE49HxAcrlQ4gfvpVJEzGbo5E/I=
Matt Kirby's avatar
Matt Kirby committed

Matt Kirby's avatar
Matt Kirby committed
  frontend-service:
    build:
      context: "./daily-thought-frontend"
      dockerfile: Dockerfile
    restart: unless-stopped
    ports:
Matt Kirby's avatar
Matt Kirby committed
    volumes:
      - ./daily-thought-frontend:/frontend-service/app
      - /frontend-service/app/node_modules
      - /frontend-service/app/.next
      - NEXT_PUBLIC_FEED_SERVICE_URL=/api/feed-service/
      - NEXT_PUBLIC_USER_SERVICE_URL=/api/user-service/
      - NEXT_PUBLIC_FRIEND_SERVICE_URL=/api/friend-service/
      - NEXT_PUBLIC_COMMENT_SERVICE_URL=/api/comment-service/
  feed-mongo:
Matt Kirby's avatar
Matt Kirby committed
    image: mongo
    container_name: feed-mongo
    ports:
      - "27017:27017"
Matt Kirby's avatar
Matt Kirby committed
  user-mongo:
    image: mongo
    container_name: user-mongo
Matt Kirby's avatar
Matt Kirby committed
    volumes:
Matt Kirby's avatar
Matt Kirby committed
      - "./mongo/user:/data/user"
    ports:
      - "27018:27017"
Matt Kirby's avatar
Matt Kirby committed
  friend-mongo:
Matt Kirby's avatar
Matt Kirby committed
    image: mongo
    container_name: friend-mongo
    ports:
      - "27019:27017"
Matt Kirby's avatar
Matt Kirby committed

  comment-mongo:
    image: mongo
    container_name: comment-mongo
    ports:
      - "27020:27017"