-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-base.yml
84 lines (79 loc) · 2.75 KB
/
docker-compose-base.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
---
## DO NOT EDIT!
# This file was provisioned by Terraform
# File origin: https://github.com/Arrow-air/tf-github/tree/main/src/templates/rust-svc/docker-compose-base.yml
version: '3.8'
# Define an extension with an anchor so it can be used as an alias to merge in the fields
x-coverage: &coverage
image: ${RUST_IMAGE_NAME}:${RUST_IMAGE_TAG}
volumes:
- type: bind
source: "${SOURCE_PATH}/"
target: "/usr/src/app"
- type: bind
source: "${SOURCE_PATH}/.cargo/registry"
target: "/usr/local/cargo/registry"
environment:
- SERVER_HOSTNAME
- SERVER_PORT_GRPC
- SERVER_PORT_REST
- RUST_BACKTRACE
security_opt:
- seccomp:unconfined
command: cargo tarpaulin --manifest-path "${CARGO_MANIFEST_PATH}" --workspace -l --include-tests --tests --no-fail-fast --features ${PACKAGE_UT_FEATURES} --skip-clean -t 600 --out Lcov --output-dir coverage/
services:
web-server:
container_name: ${DOCKER_NAME}-web-server
image: ${PACKAGE_NAME}:${DOCKER_IMAGE_TAG}
ports:
- ${HOST_PORT_REST}:${DOCKER_PORT_REST}
- ${HOST_PORT_GRPC}:${DOCKER_PORT_GRPC}
healthcheck:
test: ["CMD", "grpc_health_probe", "-addr", "localhost:${DOCKER_PORT_GRPC}"]
interval: 2s
timeout: 1s
retries: 3
start_period: 30s
volumes:
- type: bind
source: logs/
target: /logs/
configs:
- source: log4rs
target: ${LOG_CONFIG}
- source: dot-env
target: /.env
example:
links:
- web-server
depends_on:
web-server:
condition: service_healthy
container_name: ${DOCKER_NAME}-example
image: ${RUST_IMAGE_NAME}:${RUST_IMAGE_TAG}
volumes:
- type: bind
source: "${SOURCE_PATH}/"
target: "/usr/src/app"
- type: bind
source: "${SOURCE_PATH}/.cargo/registry"
target: "/usr/local/cargo/registry"
environment:
- SERVER_HOSTNAME
- SERVER_PORT_GRPC
- SERVER_PORT_REST
- EXAMPLE_TARGET
command: cargo run --manifest-path "${CARGO_MANIFEST_PATH}" --example "${EXAMPLE_TARGET}"
it-coverage: &it-coverage
<<: *coverage
container_name: ${DOCKER_NAME}-it-coverage
links:
- web-server
depends_on:
web-server:
condition: service_healthy
command: cargo tarpaulin --manifest-path "${CARGO_MANIFEST_PATH}" --workspace -l --include-tests --tests --no-fail-fast --features ${PACKAGE_IT_FEATURES} --skip-clean -t 600 --out Lcov --output-dir coverage/
ut-coverage: &ut-coverage
<<: *coverage
container_name: ${DOCKER_NAME}-ut-coverage
command: cargo tarpaulin --manifest-path "${CARGO_MANIFEST_PATH}" --workspace -l --include-tests --tests --no-fail-fast --features ${PACKAGE_UT_FEATURES} --skip-clean -t 600 --out Lcov --output-dir coverage/