version: "3" services: strapi: # container_name: strapi # removed this property oaccording to the dokploy doc because it can cause issues https://docs.dokploy.com/docs/core/docker-compose/example build: . image: strapi:latest restart: unless-stopped env_file: .env environment: DATABASE_CLIENT: ${DATABASE_CLIENT} DATABASE_HOST: strapiDB DATABASE_PORT: ${DATABASE_PORT} DATABASE_NAME: ${DATABASE_NAME} DATABASE_USERNAME: ${DATABASE_USERNAME} DATABASE_PASSWORD: ${DATABASE_PASSWORD} JWT_SECRET: ${JWT_SECRET} ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET} APP_KEYS: ${APP_KEYS} NODE_ENV: ${NODE_ENV} volumes: - ./config:/opt/app/config - ./src:/opt/app/src - ./package.json:/opt/package.json - ./yarn.lock:/opt/yarn.lock - ./.env:/opt/app/.env - ./public/uploads:/opt/app/public/uploads ports: - "1337" # no need to map the port 1337:1337 because traefik will handle the routing networks: - dokploy-network - strapi labels: - "traefik.enable=true" - "traefik.http.routers.strapi.rule=Host(`portfolio.le-dev.com`)" - "traefik.http.routers.strapi.entrypoints=websecure" - "traefik.http.routers.strapi.tls.certresolver=letsencrypt" - "traefik.http.services.strapi.loadbalancer.server.port=1337" depends_on: - strapiDB strapiDB: # container_name: strapiDB platform: linux/amd64 #for platform error on Apple M1 chips restart: unless-stopped env_file: .env image: postgres:12.0-alpine environment: POSTGRES_USER: ${DATABASE_USERNAME} POSTGRES_PASSWORD: ${DATABASE_PASSWORD} POSTGRES_DB: ${DATABASE_NAME} volumes: - strapi-data:/var/lib/postgresql/data/ #using a volume #- ./data:/var/lib/postgresql/data/ # if you want to use a bind folder ports: - "5432:5432" networks: - strapi volumes: strapi-data: networks: dokploy-network: external: true strapi: name: Strapi driver: bridge