-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.override.yml
236 lines (221 loc) · 7.36 KB
/
docker-compose.override.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# SPDX-FileCopyrightText: 2023 Ross Patterson <me@rpatterson.net>
#
# SPDX-License-Identifier: MIT
# Override `$ docker compose` configuration for development or testing here in this
# repository checkout. Put everything used outside this checkout in
# `./docker-compose.yml`.
services:
transmission:
container_name: "prunerr-devel-transmission"
volumes:
# Exit the container if the core `s6-overlay` service fails
- "./transmission/etc/s6-overlay/s6-rc.d/svc-transmission/finish\
:/etc/s6-overlay/s6-rc.d/svc-transmission/finish"
# Support adding cron jobs from the compose project:
- "./transmission/etc/crontabs/:/etc/crontabs/"
# Pause downloading when the `downloadDir` is getting low on space:
- "./transmission/usr/local/bin/transmission-pause-download:\
/usr/local/bin/transmission-pause-download"
# Shut down the container when `/config/` is running out of disk space:
- "./transmission/usr/local/bin/transmission-config-space-shutdown:\
/usr/local/bin/transmission-config-space-shutdown"
sonarr:
container_name: "prunerr-devel-sonarr"
radarr:
container_name: "prunerr-devel-radarr"
# Configuration specific to development:
prunerr-daemon:
image: "\
${DOCKER_REGISTRY_HOST:-registry.gitlab.com}/rpatterson\
/prunerr:${PYTHON_ENV:-py311}-${DOCKER_BRANCH_TAG:-develop}"
container_name: "prunerr-daemon-checkout"
build:
context: "${CHECKOUT_DIR:-.}/"
target: "user"
args:
PYTHON_MINOR: "${PYTHON_MINOR:-3.11}"
PYTHON_ENV: "${PYTHON_ENV:-py311}"
VERSION: "${VERSION:-}"
## Contianers used for development and release:
# Container for use by developers:
prunerr-devel:
image: "\
${DOCKER_REGISTRY_HOST:-registry.gitlab.com}/rpatterson\
/prunerr:devel-${PYTHON_ENV:-py311}-${DOCKER_BRANCH_TAG:-develop}"
container_name: "prunerr-devel"
profiles:
- "test"
build:
context: "${CHECKOUT_DIR:-.}/"
target: "devel"
args:
PYTHON_MINOR: "${PYTHON_MINOR:-3.11}"
PYTHON_ENV: "${PYTHON_ENV:-py311}"
VERSION: "${VERSION:-}"
environment:
TZ: "${TZ:-Etc/UTC}"
# Make the runtime user configurable in `./.env`:
PUID: "${PUID:-1000}"
PGID: "${PGID:-${PUID:-1000}}"
# Variables from the environment to pass through into the container:
CI: "${CI:-false}"
# DEBUG: "true"
# FIXME: Cleanup once fixed Prunerr entrypoint has been released:
# fix(docker): Entrypoint user should not change
PROJECT_NAME: "prunerr"
volumes:
# Reflect local changes inside the container:
- "${CHECKOUT_DIR:-.}/bin/entrypoint.sh:/usr/local/bin/entrypoint.sh"
- type: "volume"
source: "prunerr_checkout"
target: "/usr/local/src/prunerr"
# Preserve user configuration, data, and caches between containers and variants:
- type: "volume"
source: "home_config"
target: "/home/prunerr/.config"
- type: "volume"
source: "home_local_share"
target: "/home/prunerr/.local/share"
- type: "volume"
source: "home_cache"
target: "/home/prunerr/.cache"
# Preserve shell history inside containers, requires `$ touch
# ./home/.bash_history`:
- "./home/.bash_history:/home/prunerr/.bash_history"
# Avoid any clashes between image variants and the local host at both build and
# runtime:
- "${CHECKOUT_DIR:-.}/var-docker/${PYTHON_ENV:-py311}/\
:/usr/local/src/prunerr/var/"
- "${CHECKOUT_DIR:-.}/var-docker/${PYTHON_ENV:-py311}/.tox/\
:/usr/local/src/prunerr/.tox/"
- "${CHECKOUT_DIR:-.}/var-docker/${PYTHON_ENV:-py311}\
/prunerr.egg-info/\
:/usr/local/src/prunerr/src/prunerr.egg-info/"
# https://github.com/hadolint/hadolint#how-to-use
hadolint:
image: "ghcr.io/hadolint/hadolint"
profiles:
- "test"
environment:
TZ: "${TZ:-Etc/UTC}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/usr/local/src/prunerr"
working_dir: "/usr/local/src/prunerr/"
command: >-
hadolint "./Dockerfile"
reuse:
image: "docker.io/fsfe/reuse:latest-debian"
profiles:
- "lint"
user: "${PUID:-1000}:${PGID:-${PUID:-1000}}"
environment:
TZ: "${TZ:-Etc/UTC}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/data"
command: >-
lint
vale:
image: "docker.io/jdkato/vale:v2.28.1"
profiles:
- "lint"
user: "${PUID:-1000}:${PGID:-${PUID:-1000}}"
environment:
TZ: "${TZ:-Etc/UTC}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/usr/local/src/prunerr"
working_dir: "/usr/local/src/prunerr"
command: >-
.
pandoc:
image: "docker.io/pandoc/core"
profiles:
- "release"
user: "${PUID:-1000}:${PGID:-${PUID:-1000}}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/data"
entrypoint: "ash"
# Strip reStructuredText directives unsupported in Markdown before converting, for
# example table of contents, and converted Markdown that isn't widely supported, for
# example tables:
command: >-
-xeu -c '
grep -Ev "^ *\.\. +(contents)::.*" "./README.rst" |
pandoc -f "rst" -t "gfm" | grep -Ev "^(\+-+\+|\|.*\|)$" >"./README.md"
'
docker-pushrm:
image: "chko/docker-pushrm"
depends_on:
pandoc:
condition: "service_completed_successfully"
profiles:
- "release"
environment:
TZ: "${TZ:-Etc/UTC}"
DOCKER_USER: "${DOCKER_USER:-}"
DOCKER_PASS: "${DOCKER_PASS:-}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/data"
command: >-
--file "/data/var/README.md"
--short "Perma-seed Servarr media libraries"
--debug "${DOCKER_USER:-}/prunerr"
gitlab-release-cli:
image: "registry.gitlab.com/gitlab-org/release-cli:latest"
profiles:
- "release"
environment:
CI_JOB_TOKEN: "${CI_JOB_TOKEN:-}"
volumes:
- type: "volume"
source: "prunerr_checkout"
target: "/usr/local/src/prunerr"
working_dir: "/usr/local/src/prunerr/"
## Containers related to CI/CD:
# The container that runs CI/CD:
build-host:
image: "\
${DOCKER_REGISTRY_HOST:-registry.gitlab.com}/rpatterson/prunerr\
:build-host"
profiles:
- "ci"
build: "${CHECKOUT_DIR:-.}/build-host/"
privileged: true
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- type: "volume"
source: "prunerr_checkout"
target: "${CHECKOUT_DIR:-.}"
- "${CHECKOUT_DIR:-.}/build-host/bin/init-job.sh:/usr/local/bin/init-job.sh"
- "${CHECKOUT_DIR:-.}/build-host/bin/entrypoint.sh:/usr/local/bin/entrypoint.sh"
# Share local SSH authentication to repository remotes
- "~/.ssh/:/home/runner/.ssh/"
env_file: "./.env"
environment:
TZ: "${TZ:-Etc/UTC}"
PUID: "${PUID:-1000}"
PGID: "${DOCKER_GID:-${PGID:-${PUID:-1000}}}"
# DEBUG: "true"
working_dir: "${CHECKOUT_DIR:-.}"
command: >-
make -e test-lint build-docker test-docker release
gitlab-runner:
profiles:
- "ci"
volumes:
prunerr_checkout:
name: "prunerr_checkout"
driver: "local"
driver_opts:
type: "none"
o: "bind"
device: "${CHECKOUT_DIR:-.}/"