-
Notifications
You must be signed in to change notification settings - Fork 554
Expand file tree
/
Copy pathdocker-compose.ci.yml
More file actions
47 lines (45 loc) · 2.08 KB
/
docker-compose.ci.yml
File metadata and controls
47 lines (45 loc) · 2.08 KB
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
# This docker compose file is a minimal override file that goes with
# docker-compose.yml and is intended to be used in CI to run tests without
# a full environment (without running `make up`).
#
# Aside from overring healthchecks and dependencies, it does not bind mount the
# whole repos to /data/olympia, relying only on the contents of the image with
# named volumes for deps/node_modules as we need to install more on top of the
# production image for tests.
# Because it doesn't use a bound volume for the code, the entrypoint is also
# overridden as all the usermod shenanigans we'd normally need don't apply.
#
# Gotchas when running locally to test CI behavior:
# - Remove any stale stale data_deps_ci or data_node_modules_ci volumes
# - Use a production container with development deps. CI executes this first:
# make up_pre DOCKER_VERSION=local \
# DOCKER_DIGEST= \
# DOCKER_TARGET=production \
# OLYMPIA_DEPS=development
services:
web:
# We don't want any healthchecks, this is to run a one-off pytest command.
healthcheck: !override
test: ['CMD','true']
# Minimal dependencies. Jobs may start other services on their own.
depends_on: !override
mysqld:
condition: service_healthy
memcached:
condition: service_started
# We don't need to bind the local filesystem like we do for development,
# but we do need a persistent deps volume to install dependencies used for
# testing not present in the production image.
# When mounting an empty volume into a directory on the container in which
# files exist, those files are copied into the volume by default, which
# means we'll only need to install development dependencies, the production
# ones are already there.
volumes: !override
- data_deps_ci:/data/olympia/deps
- data_node_modules_ci:/data/olympia/node_modules
# Since we're not using a bind mount, we shouldn't use our development
# entrypoint that runs commands as the host user uid.
entrypoint: !override ''
volumes:
data_deps_ci:
data_node_modules_ci: