diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..e8e3dad --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,167 @@ +x-environment-variables: + &default-environment + API_PREFIX: "/palpatine" + DELEGATED_STORAGE_RATE_LIMIT: 5 + DELEGATED_STORAGE_RATE_LIMIT_WINDOW: 30000 + THUMBOR_SERVICE: http://localhost:8888 + NGINX_SERVICE: http://host.docker.internal:8080 + IMAGE_SERVICE: http://localhost:3001 + NGINX_INGRESS: http://localhost:8080 + + VERSION: 0.0.1 + NAMESPACES: CMS,FORMS,DEV + VALID_MIMETYPES: image/png,image/jpeg,application/pdf,image/jpg,image/webp,image/svg+xml + + DEV_ENV: true + + # GLOUTON API: + # DELEGATED_STORAGE_HOST: http://host.docker.internal:3002 + # DELEGATED_STORAGE_READINESS_CHECK: /readiness-check + # DELEGATED_STORAGE_GET_PATH: + # DELEGATED_STORAGE_POST_PATH: + # DELEGATED_STORAGE_PUT_PATH: + # DELEGATED_STORAGE_DELETE_PATH: + # DELEGATED_STORAGE_TOKEN: NinjaDesIles + + # S3 BACKUP : + DELEGATED_STORAGE_READINESS_CHECK: /minio/health/live + DELEGATED_STORAGE_HOST: http://localhost:9000 + + DELEGATED_STORAGE_METHOD: S3 + + S3_ENDPOINT: localhost + S3_PORT: 9000 + S3_ACCESS_KEY: minioadmin + S3_SECRET_KEY: minioadmin + S3_BUCKET_NAME: media + + DUMP_FOLDER_PATH: /dumps + REDIS_SERVICE: localhost + + HEALTHCHECK_ROUTE: /readiness-check + + PAYLOAD_MAX_SIZE: "10mb" + BASE_TIMEOUT_MS: 1000 + + ORIGINS_ALLOWED: localhost,* + METHODS_ALLOWED: GET,POST + + USE_STRIPMETADATA: true + TMP_FILES_PATH: './images' + + +services: + redis: + image: bitnami/redis:7.0.15-debian-12-r20 + container_name: redis_server + command: redis-server --protected-mode no --dir /dumps + ports: + - '6379:6379' + volumes: + - ./local/redis/dumps:/dumps + networks: + - redis_net + redisinsight: + image: redis/redisinsight:latest + container_name: redisinsight + ports: + - '5540:5540' + networks: + - redis_net + depends_on: + - redis + + minio: + image: minio/minio + ports: + - 9000:9000 + - 8900:8900 + environment: + MINIO_ROOT_USER: 'minioadmin' + MINIO_ROOT_PASSWORD: 'minioadmin' + command: 'minio server /data/minio --console-address ":8900"' + volumes: + - pv-minio:/data/minio + networks: + - media_network + + images-provider: + build: + context: src/api + dockerfile: Dockerfile.dev + ports: + - 3001:3001 + networks: + - media_network + - redis_net + volumes: + - ./local/redis/dumps:/dumps + - ./local/logs:/logs + environment: + <<: *default-environment + THUMBOR_SERVICE: http://thumbor:8888 + NGINX_SERVICE: http://nginx:8080 + IMAGE_SERVICE: http://images-provider:3001 + NGINX_INGRESS: http://localhost:8080 + DELEGATED_STORAGE_HOST: http://minio:9000 + REDIS_SERVICE: redis + S3_ENDPOINT: minio + healthcheck: + test: ["CMD-SHELL", "wget --spider --quiet http://images-provider:3001$$API_PREFIX/readiness-check || exit 1"] + interval: 10s + timeout: 7s + retries: 5 + nginx-purge: + image: emcniece/nginx-cache-purge:1.13-alpine + ports: + - 8081:8081 + volumes: + - ./local/nginx/nginx-purge.conf:/etc/nginx/nginx.conf + networks: + - media_network + depends_on: + - images-provider + nginx: + image: bitnami/nginx:latest + ports: + - 8080:8080 + volumes: + - ./local/nginx/nginx.conf:/opt/bitnami/nginx/conf/nginx.conf + networks: + - media_network + depends_on: + - images-provider + job: + build: + context: src/ + dockerfile: Dockerfile.dev + ports: + - 3006:3006 + networks: + - media_network + volumes: + - ./local/logs:/logs + depends_on: + images-provider: + condition: service_healthy + environment: + <<: *default-environment + IMAGE_SERVICE: http://images-provider:3001 + API_SERVICE: http://images-provider:3001 + API_PREFIX: /palpatine + DEV_ENV: true + CATALOG_ROUTE: '/catalog' + GET_ROUTE: '/assets/media/' + +volumes: + pv-minio: + minio: + driver: local + caddy_data: + caddy_config: + +networks: + redis_net: + driver: bridge + media_network: + driver: bridge diff --git a/docker-compose.yml b/docker-compose.yml index e8e3dad..aeeedf3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -88,7 +88,7 @@ services: images-provider: build: context: src/api - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 3001:3001 networks: @@ -134,7 +134,7 @@ services: job: build: context: src/ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 3006:3006 networks: