-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakejail
More file actions
65 lines (43 loc) · 1.72 KB
/
Makejail
File metadata and controls
65 lines (43 loc) · 1.72 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
ARG postgres_version
OPTION start
OPTION overwrite=force
OPTION volume=pg-db mountpoint:/var/db/postgres owner:${puid} group:${pgid}
OPTION volume=pg-data mountpoint:/var/db/postgres/data${postgres_version} owner:${puid} group:${pgid} perm:700
OPTION volume=pg-done mountpoint:/.psql-done
INCLUDE gh+AppJail-makejails/user-mapping
PKG postgresql${postgres_version}-server
SYSRC postgresql_user=noroot
SYSRC "postgresql_data=/var/db/postgres/data${postgres_version}"
CMD find /var/db/postgres -user postgres -exec chown -h noroot {} +
CMD find /var/db/postgres -group postgres -exec chown -h :noroot {} +
RAW if appjail cmd jexec "${APPJAIL_JAILNAME}" [ -f "/.psql-done/skip-scripts" ]; then
CMD echo "======> Installation appears to have a PostgreSQL already configured, the scripts will not run. <======"
CMD mkdir -p /scripts
COPY scripts/default.conf /scripts
COPY scripts/lib.subr /scripts
COPY scripts/rc.sh /scripts
WORKDIR /scripts
RUN ./rc.sh
RAW else
CMD echo "======> Installing scripts ... <======"
COPY --verbose scripts
CMD echo "======> Configuring ... <======"
WORKDIR /scripts
USER noroot
CMD echo "======> Configuring 'initdb' ... <======"
RUN ./initdb.sh
CMD echo "======> Configuring 'pg_hba.conf' ... <======"
RUN ./pg_hba.sh
CLEAR user
CMD echo "======> Configuring 'RC script' ... <======"
RUN ./rc.sh
USER postgres
CMD echo "======> Creating database ... <======"
RUN ./setup-db.sh
CMD echo "======> Running 'initdb scripts' ... <======"
RUN ./init-files.sh
CMD echo "======> Uninstalling scripts ... <======"
CMD rm -rf /scripts
CMD mkdir -p "/.psql-done"
CMD touch "/.psql-done/skip-scripts"
RAW fi