forked from dzikoysk/reposilite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.split.yml
More file actions
91 lines (86 loc) 路 3.48 KB
/
Copy pathdocker-compose.split.yml
File metadata and controls
91 lines (86 loc) 路 3.48 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
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
# The dashboard and the server in separate containers.
#
# docker compose -f docker-compose.split.yml up -d
#
# Only the dashboard publishes a port. The server is reachable on the internal network
# alone, and everything that is not the dashboard's own static content is proxied to it, so
# both stay on one origin and no repository read needs CORS.
#
# The plain docker-compose.yml next to this file runs the server on its own, serving the
# dashboard itself. That is the simpler deployment; see
# reposilite-site/data/guides/installation/split-containers.md for when this one is worth
# the extra moving part.
services:
dashboard:
image: ghcr.io/onelitefeathernet/ingot-dashboard:1.1.0 # x-release-please-version
#
# To build from sources:
#
# build:
# context: .
# dockerfile: reposilite-frontend/Dockerfile
ports:
- ${PORT}:8080
environment:
# Resolved per request, so this container starts whether or not the server is up yet.
- INGOT_BACKEND=http://server:8080
- INGOT_RESOLVER=127.0.0.11
- INGOT_MAX_UPLOAD_SIZE=1024m
depends_on:
- server
restart: unless-stopped
# Static content and a proxy: nothing to write, nothing to escalate into.
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# The paths nginx writes anyway. They need the image's own uid, otherwise the mounts
# land owned by root and nginx cannot render its config into conf.d, which leaves it
# running with no server block at all rather than failing outright.
tmpfs:
- /tmp:uid=101,gid=101
- /var/cache/nginx:uid=101,gid=101
- /var/run:uid=101,gid=101
- /etc/nginx/conf.d:uid=101,gid=101
server:
image: ghcr.io/onelitefeathernet/ingot:1.1.0 # x-release-please-version
#
# To build from sources:
#
# build:
# context: .
# dockerfile: Dockerfile
env_file:
- .env
environment:
- JAVA_OPTS=-Xmx${MEMORY} ${JAVA_COMPOSE_OPTS}
- INGOT_OPTS=--port 8080 ${INGOT_COMPOSE_OPTS}
# The dashboard is served by the other container, so this one should not answer for
# it as well. Two copies at different URLs is the confusing outcome, not a safe one.
- INGOT_LOCAL_DEFAULTFRONTEND=false
volumes:
- ingot-data:/app/data
restart: unless-stopped
# Kept for the interactive console, which is how the first access token is generated.
stdin_open: true
tty: true
# Not read_only: the server writes artifacts, logs and its database. Running it
# unprivileged is where the value is here instead.
#
# The image itself starts as root and drops privileges in its entrypoint, the way the
# upstream Reposilite image does, because that is the only path that can take over a
# volume owned by somebody else or honour PUID and PGID. Pinning the user here is safe
# precisely because this volume is created empty by this file, so it is owned by 977
# from the start. Drop this line if you point the service at an existing data directory
# with a different owner, and let the entrypoint sort the ownership out once.
user: "977:977"
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# Deliberately not published. Reaching the server means going through the dashboard,
# which is the only thing that should be exposed. Add a ports entry only if something
# has to talk to it directly, and know that it bypasses the proxy when you do.
volumes:
ingot-data: {}