@@ -4,33 +4,98 @@ services:
44 build :
55 context : .
66 dockerfile : ./dockerfiles/Dockerfile
7+ target : web-server
78 platform : " linux/amd64"
89 depends_on :
910 - db
1011 - s3
1112 ports :
12- - " 3000:3000"
13- # for metrics
14- expose : ["3000"]
15- volumes :
16- - " /var/run/docker.sock:/var/run/docker.sock"
17- - " .rustwide-docker:/opt/docsrs/rustwide"
18- - " cratesio-index:/opt/docsrs/prefix/crates.io-index"
13+ - " 3000:80"
1914 environment :
20- DOCSRS_RUSTWIDE_WORKSPACE : /opt/docsrs/rustwide
15+ DOCSRS_PREFIX : /opt/docsrs/prefix
2116 DOCSRS_DATABASE_URL : postgresql://cratesfyi:password@db
2217 DOCSRS_STORAGE_BACKEND : s3
2318 S3_ENDPOINT : http://s3:9000
2419 AWS_ACCESS_KEY_ID : cratesfyi
2520 AWS_SECRET_ACCESS_KEY : secret_key
2621 env_file :
2722 - .env
23+ healthcheck :
24+ test : ["CMD", "curl", "--silent", "--fail", "localhost:80"]
25+ interval : 10s
26+ timeout : 5s
27+ retries : 10
28+
29+ registry-watcher :
30+ build :
31+ context : .
32+ dockerfile : ./dockerfiles/Dockerfile
33+ target : registry-watcher
34+ platform : " linux/amd64"
35+ depends_on :
36+ - db
37+ volumes :
38+ - " cratesio-index:/opt/docsrs/prefix/crates.io-index"
39+ environment :
40+ DOCSRS_PREFIX : /opt/docsrs/prefix
41+ DOCSRS_DATABASE_URL : postgresql://cratesfyi:password@db
42+ env_file :
43+ - .env
2844 healthcheck :
2945 test : ["CMD", "curl", "--silent", "--fail", "localhost:3000"]
3046 interval : 10s
3147 timeout : 5s
3248 retries : 10
3349
50+ builder :
51+ build :
52+ context : .
53+ dockerfile : ./dockerfiles/Dockerfile
54+ target : build-server
55+ depends_on :
56+ - db
57+ - s3
58+ volumes :
59+ - " /var/run/docker.sock:/var/run/docker.sock"
60+ - " cratesio-index:/opt/docsrs/prefix/crates.io-index"
61+ environment :
62+ RUST_BACKTRACE : true
63+ DOCSRS_PREFIX : /opt/docsrs/prefix
64+ DOCSRS_RUSTWIDE_WORKSPACE : /opt/docsrs/rustwide
65+ DOCSRS_DOCKER : true
66+ DOCSRS_DOCKER_IMAGE : ghcr.io/rust-lang/crates-build-env/linux-micro
67+ DOCSRS_DATABASE_URL : postgresql://cratesfyi:password@db
68+ DOCSRS_STORAGE_BACKEND : s3
69+ S3_ENDPOINT : http://s3:9000
70+ AWS_ACCESS_KEY_ID : cratesfyi
71+ AWS_SECRET_ACCESS_KEY : secret_key
72+ env_file :
73+ - .env
74+ deploy :
75+ replicas : 2
76+
77+ cli :
78+ build :
79+ context : .
80+ dockerfile : ./dockerfiles/Dockerfile
81+ target : cli
82+ depends_on :
83+ - db
84+ - s3
85+ volumes :
86+ - " cratesio-index:/opt/docsrs/prefix/crates.io-index"
87+ environment :
88+ DOCSRS_PREFIX : /opt/docsrs/prefix
89+ DOCSRS_RUSTWIDE_WORKSPACE : /opt/docsrs/rustwide
90+ DOCSRS_DOCKER : true
91+ DOCSRS_DATABASE_URL : postgresql://cratesfyi:password@db
92+ DOCSRS_STORAGE_BACKEND : s3
93+ S3_ENDPOINT : http://s3:9000
94+ AWS_ACCESS_KEY_ID : cratesfyi
95+ AWS_SECRET_ACCESS_KEY : secret_key
96+ env_file :
97+ - .env
98+
3499 db :
35100 build :
36101 context : ./dockerfiles
0 commit comments