nuastudios / di-companion

MIT License
0 stars 0 forks source link

Setup docker environment (docker-compose) #1

Open simonline opened 5 days ago

simonline commented 5 days ago

Create adocker-compose.yml file to orchestrate the following services:

simonline commented 5 days ago

Current config:

services:
  postgres:
    container_name: postgres
    image: postgres:17
    restart: always
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: di
      POSTGRES_USER: di
      POSTGRES_PASSWORD: ****
    networks:
      - backend

  strapi:
    container_name: strapi
    build: ./di-companion/strapi
    image: strapi:latest
    restart: unless-stopped
    env_file: ./di-companion/strapi/.env
    environment:
      DATABASE_CLIENT: postgres
      DATABASE_HOST: postgres
      DATABASE_PORT: 5432
      DATABASE_NAME: di
      DATABASE_USERNAME: di
      DATABASE_PASSWORD: ****
      JWT_SECRET: ****
      ADMIN_JWT_SECRET: ****
      APP_KEYS: ****
      NODE_ENV: production
    volumes:
      - ./di-companion/strapi/config:/opt/app/config
      - ./di-companion/strapi/src:/opt/app/src
      - ./di-companion/strapi/package.json:/opt/package.json
      - ./di-companion/strapi/yarn.lock:/opt/yarn.lock
      - ./di-companion/strapi/.env:/opt/app/.env
      - ./di-companion/strapi/public/uploads:/opt/app/public/uploads
    ports:
      - "1337:1337"
    depends_on:
      - postgres
    networks:
      - backend
      - web

networks:
  web:
  backend:

volumes:
  postgres_data:
  strapi_data: