Skip to content

Commit 190f715

Browse files
committed
supervisord and docker changes for OpenShift compatibility
1 parent c1785b5 commit 190f715

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

deploy/docker/Dockerfile

+16-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ EXPOSE 3443
169169
FROM lowcoder-ce-frontend
170170
LABEL maintainer="lowcoder"
171171

172-
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates gnupg
172+
RUN apt-get update && apt-get upgrade -y \
173+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates gnupg \
174+
&& rm -rf /var/cache/apt/lists /var/lib/apt/lists/* /var/log/dpkg.log \
175+
&& apt-get clean
173176

174177
# Add nodejs repo and keys
175178
RUN mkdir -p /etc/apt/keyrings \
@@ -197,7 +200,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
197200
nodejs \
198201
openjdk-17-jdk-headless \
199202
&& npm install -g yarn \
200-
&& rm -rf /var/cache/apt/lists \
203+
&& rm -rf /var/cache/apt/lists /var/lib/apt/lists/* /var/log/dpkg.log \
201204
&& mkdir -p /lowcoder/assets \
202205
&& apt-get clean \
203206
&& rm -rf /tmp/*
@@ -214,6 +217,17 @@ COPY --chown=lowcoder:lowcoder deploy/docker/all-in-one/etc /lowcoder/etc
214217
# Add startup script
215218
COPY --chown=lowcoder:lowcoder deploy/docker/all-in-one/entrypoint.sh /lowcoder/entrypoint.sh
216219

220+
# Fixes for OpenShift compatibility (after all files are copied)
221+
RUN echo \
222+
&& adduser lowcoder root \
223+
&& mkdir -p /lowcoder-stacks \
224+
&& for i in /lowcoder-stacks /lowcoder/assets /lowcoder/api-service/logs /lowcoder/etc/supervisord; do \
225+
chmod -R g+rw "$i"; \
226+
chown -R lowcoder:root "$i"; \
227+
done \
228+
&& chown -R lowcoder:root /var/log \
229+
&& chmod -R g+rw /run /etc/nginx /var/cache/nginx /var/log
230+
217231
EXPOSE 27017
218232
EXPOSE 3000
219233
EXPOSE 3443
+11-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
; supervisor config file
22

33
[unix_http_server]
4-
file=/var/run/supervisor.sock ; (the path to the socket file)
5-
chmod=0700 ; sockef file mode (default 0700)
4+
file = /var/run/supervisor.sock ; (the path to the socket file)
5+
chmod = 0700 ; socket file mode (default 0700)
66

77
[inet_http_server] ; inet (TCP) server disabled by default
88
port=*:9001 ; (ip_address:port specifier, *:port for all iface)
99
;username=user ; (default is no username (open server))
1010
;password=123 ; (default is no password (open server))
1111

1212
[supervisord]
13-
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
14-
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
15-
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
13+
logfile = /dev/null ; (no logfile, stdout only; default $CWD/supervisord.log)
14+
pidfile = /var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
15+
childlogdir = /var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
16+
logfile_maxbytes = 0
1617
stdout_logfile_maxbytes = 0
1718
stderr_logfile_maxbytes = 0
1819

@@ -23,7 +24,7 @@ stderr_logfile_maxbytes = 0
2324
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
2425

2526
[supervisorctl]
26-
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
27+
serverurl = unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
2728

2829
; The [include] section can just contain the "files" setting. This
2930
; setting can list multiple files (separated by whitespace or
@@ -37,8 +38,8 @@ files = /lowcoder/etc/supervisord/conf-enabled/*.conf
3738
# ; This event listener is used to capture processes log
3839
# ; and forward to container log using supervisor_stdout
3940
# ; Ref: https://github.com/coderanger/supervisor-stdout
40-
# [eventlistener:stdout]
41-
# command = supervisor_stdout
42-
# buffer_size = 100
43-
# events = PROCESS_LOG
41+
# [eventlistener:stdout]
42+
# command = supervisor_stdout
43+
# buffer_size = 100
44+
# events = PROCESS_LOG
4445
# result_handler = supervisor_stdout:event_handler

0 commit comments

Comments
 (0)