version: "2"
services:
  app:
    image: martadinata666/reactive-resume:latest
    restart: unless-stopped
    environment:
      - SECRET_KEY=${SECRET_KEY}
      - POSTGRES_HOST=db
      - POSTGRES_PORT=5432
      - POSTGRES_USER=${DATABASE_USERNAME}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
      - POSTGRES_DB=reactiveresume
      - JWT_SECRET=${JWT_SECRET}
      - GOOGLE_API_KEY=${GOOGLE_API_KEY}
      - PUBLIC_FLAG_DISABLE_SIGNUPS=${DISABLE_SIGNUPS}
      - PUBLIC_URL=${PUBLIC_URL}
      - PUBLIC_SERVER_URL=${PUBLIC_SERVER_URL}
    volumes:
      - /portainer/Files/AppData/Config/reactive-resume/uploads:/home/debian/reactiveresume/server/dist/assets/uploads
      - /portainer/Files/AppData/Config/reactive-resume/exports:/home/debian/reactiveresume/server/dist/assets/exports
    ports:
      - ${CLIENT_PORT}:3000
      - ${SERVER_PORT}:3100

  db:
    image: postgres:13
    user: 1000:1000
    environment:
      - POSTGRES_USER=${DATABASE_USERNAME}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
      - POSTGRES_DB=reactiveresume
    restart: always
    volumes:
      - /portainer/Files/AppData/Config/reactive-resume/db:/var/lib/postgresql/data

