๐Ÿ“ฆ rust-lang / crates.io

๐Ÿ“„ docker-compose.yml ยท 69 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69x-backend: &backend
  build:
    context: .
    dockerfile: backend.Dockerfile
  environment:
    DEV_DOCKER: "true"
    DATABASE_URL: postgres://postgres:password@postgres/cargo_registry
    SESSION_KEY: badkeyabcdefghijklmnopqrstuvwxyzabcdef
    GIT_REPO_URL: file:///app/tmp/index-bare
    GH_CLIENT_ID: ""
    GH_CLIENT_SECRET: ""
    WEB_ALLOWED_ORIGINS: http://localhost:8888,http://localhost:4200
  links:
    - postgres
  volumes:
    # Mount the src/ directory so we don't have to rebuild the Docker image
    # when we want to change some code
    - ./src:/app/src:ro

    - index:/app/tmp
    - cargo-cache:/usr/local/cargo/registry
    - target-cache:/app/target
    - local-uploads:/app/local_uploads

services:
  postgres:
    image: postgres:16@sha256:1bf73ccae25238fa555100080042f0b2f9be08eb757e200fe6afc1fc413a1b3c
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - 127.0.0.1:5432:5432
    volumes:
      - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
      - postgres-data:/var/lib/postgresql/data

  backend:
    <<: *backend
    ports:
      - 8888:8888
    depends_on:
      - postgres

  worker:
    <<: *backend
    entrypoint: cargo run --bin background-worker
    depends_on:
      - backend

  frontend:
    build:
      context: .
      dockerfile: frontend.Dockerfile
    entrypoint: pnpm start:docker
    links:
      - backend
    ports:
      - 4200:4200
    volumes:
      # Mount the app/ directory so live reload works
      - ./app:/app/app:ro

volumes:
  postgres-data:
  cargo-cache:
  target-cache:
  index:
  local-uploads: