forked from pypi/warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
186 lines (171 loc) · 5.16 KB
/
docker-compose.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
version: '3.9'
volumes:
simple:
packages:
sponsorlogos:
policies:
vault:
caches:
services:
vault:
# NOTE: intentionally an older version, for consistency with cabotage
image: vault:1.3.4
restart: on-failure
entrypoint: /bin/sh
command: ["/etc/vault/entry.sh"]
environment:
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
VAULT_DEV_ROOT_TOKEN_ID: "an insecure vault access token"
ports:
- "8200:8200"
cap_add:
- IPC_LOCK
volumes:
- vault:/vault/file
- ./dev/vault:/etc/vault
db:
image: postgres:14.4
ports:
# 5432 may already in use by another PostgreSQL on host
- "5433:5432"
environment:
POSTGRES_HOST_AUTH_METHOD: trust # never do this in production!
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 1s
stripe:
image: stripe/stripe-mock:v0.140.0
ports:
- "12111:12111"
redis:
image: redis:4.0
localstack:
image: localstack/localstack:0.12.19.1
environment:
SERVICES: "sqs"
HOSTNAME: "localstack"
HOSTNAME_EXTERNAL: "localstack"
DEFAULT_REGION: "us-east-2"
ports:
- "4566:4566"
elasticsearch:
image: elasticsearch:7.10.1
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
nofile:
soft: 65536
hard: 65536
camo:
image: pypa/warehouse-camo:latest
ports:
- "9000:9000"
environment:
CAMO_KEY: "insecurecamokey"
PORT: 9000
web:
build:
context: .
args:
DEVEL: "yes"
IPYTHON: "no"
command: gunicorn --reload -b 0.0.0.0:8000 warehouse.wsgi:application
env_file: dev/environment
volumes:
# We specify all of these directories instead of just . because we want to
# avoid having ./node_modules from the host OS being shared with the docker
# container, and since there's no way to exclude a directory, the only way
# to make this work is to share multiple, smaller directories. These cover
# the important things that we want to share, but changes to requirements
# or any file not in these directories will require a rebuild.
# The :z option fixes permission issues with SELinux by setting a
# permissive security context.
- ./dev:/opt/warehouse/src/dev:z
- ./docs:/opt/warehouse/src/docs:z
- ./warehouse:/opt/warehouse/src/warehouse:z
- ./tests:/opt/warehouse/src/tests:z
- ./htmlcov:/opt/warehouse/src/htmlcov:z
- .coveragerc:/opt/warehouse/src/.coveragerc:z
- packages:/var/opt/warehouse/packages
- sponsorlogos:/var/opt/warehouse/sponsorlogos
- policies:/var/opt/warehouse/policies
- simple:/var/opt/warehouse/simple
- ./bin:/opt/warehouse/src/bin:z
- ./requirements:/opt/warehouse/src/requirements:z
- caches:/root/.cache
- caches:/opt/warehouse/src/.mypy_cache
- caches:/opt/warehouse/src/.pytest_cache
ports:
- "${WEB_PORT:-80}:8000"
depends_on:
db:
condition: service_healthy
elasticsearch:
condition: service_started
redis:
condition: service_started
stripe:
condition: service_started
files:
build:
context: .
working_dir: /var/opt/warehouse
command: python -m http.server 9001
volumes:
- packages:/var/opt/warehouse/packages
- sponsorlogos:/var/opt/warehouse/sponsorlogos
- simple:/var/opt/warehouse/simple
ports:
- "9001:9001"
worker:
build:
context: .
args:
DEVEL: "yes"
command: hupper -m celery -A warehouse worker -B -S redbeat.RedBeatScheduler -l info
volumes:
- ./warehouse:/opt/warehouse/src/warehouse:z
env_file: dev/environment
environment:
C_FORCE_ROOT: "1"
FILES_BACKEND: "warehouse.packaging.services.LocalFileStorage path=/var/opt/warehouse/packages/ url=http://files:9001/packages/{path}"
SIMPLE_BACKEND: "warehouse.packaging.services.LocalSimpleStorage path=/var/opt/warehouse/simple/ url=http://files:9001/simple/{path}"
static:
build:
context: .
target: static-deps
environment:
NODE_ENV: "development"
command: bash -c "npm run watch"
volumes:
- ./warehouse:/opt/warehouse/src/warehouse:z
- ./webpack.config.js:/opt/warehouse/src/webpack.config.js:z
- ./.babelrc:/opt/warehouse/src/.babelrc:z
- ./.stylelintrc.json:/opt/warehouse/src/.stylelintrc.json:z
- ./tests/frontend:/opt/warehouse/src/tests/frontend:z
- ./bin:/opt/warehouse/src/bin:z
- caches:/opt/warehouse/src/.stylelintcache
maildev:
image: maildev/maildev:2.0.2
ports:
- "1080:1080"
- "1025:1025"
notdatadog:
build:
context: .
args:
DEVEL: "yes"
command: python /opt/warehouse/dev/notdatadog.py 0.0.0.0:8125
environment:
METRICS_OUTPUT: "false"
ports:
- "8125:8125/udp"
volumes:
- ./dev/notdatadog.py:/opt/warehouse/dev/notdatadog.py
notgithub:
image: ewjoachim/notgithub-token-scanning
environment:
NOTGITHUB_DEFAULT_URL: "http://web:8000/_/github/disclose-token"
ports:
- "8964:8000"