version: "3" services: web: build: context: . dockerfile: ./dockerfiles/Dockerfile depends_on: - db - s3 ports: - "3000:3000" # for metrics expose: ["3000"] volumes: - "/var/run/docker.sock:/var/run/docker.sock" - ".rustwide-docker:/opt/docsrs/rustwide" - "cratesio-index:/opt/docsrs/prefix/crates.io-index" environment: CRATESFYI_RUSTWIDE_WORKSPACE: /opt/docsrs/rustwide CRATESFYI_DATABASE_URL: postgresql://cratesfyi:password@db DOCSRS_STORAGE_BACKEND: s3 S3_ENDPOINT: http://s3:9000 AWS_ACCESS_KEY_ID: cratesfyi AWS_SECRET_ACCESS_KEY: secret_key env_file: - .env healthcheck: test: ["CMD", "curl", "--silent", "--fail", "localhost:3000"] interval: 10s timeout: 5s retries: 10 db: build: context: ./dockerfiles dockerfile: ./Dockerfile-postgres volumes: - postgres-data:/var/lib/postgresql/data environment: POSTGRES_USER: cratesfyi POSTGRES_PASSWORD: password ports: # Use a non-standard port on the host to avoid conflicting with existing postgres servers - "15432:5432" healthcheck: test: ["CMD", "pg_isready", "--username", "cratesfyi"] interval: 10s timeout: 5s retries: 10 s3: image: minio/minio entrypoint: > /bin/sh -c " mkdir -p /data/rust-docs-rs; minio server /data; " ports: - "9000:9000" volumes: - minio-data:/data environment: MINIO_ACCESS_KEY: cratesfyi MINIO_SECRET_KEY: secret_key healthcheck: test: [ "CMD", "curl", "--silent", "--fail", "localhost:9000/minio/health/ready", ] interval: 10s timeout: 5s retries: 10 prometheus: build: context: ./dockerfiles dockerfile: ./Dockerfile-prometheus ports: - "9090:9090" healthcheck: test: ["CMD", "curl", "--silent", "--fail", "localhost:9090/-/ready"] interval: 10s timeout: 5s retries: 10 volumes: postgres-data: {} minio-data: {} cratesio-index: {}