Skip to content

Commit 7de19c2

Browse files
committed
fix: move frontend configuration to it's entrypoint
1 parent d457bb1 commit 7de19c2

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

deploy/docker/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ RUN yarn build
135135
FROM nginx:1.23.4 as lowcoder-ce-frontend
136136
LABEL maintainer="lowcoder"
137137

138-
# Change default nginx user into lowcoder user
138+
# Change default nginx user into lowcoder user and remove default nginx config
139139
RUN usermod --login lowcoder --uid 9001 nginx \
140-
&& groupmod --new-name lowcoder --gid 9001 nginx
140+
&& groupmod --new-name lowcoder --gid 9001 nginx \
141+
&& rm -f /etc/nginx/nginx.conf
141142

142143
# Copy lowcoder client data
143144
COPY --chown=lowcoder:lowcoder --from=build-client /lowcoder-client/packages/lowcoder/build/ /lowcoder/client

deploy/docker/all-in-one/entrypoint.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,6 @@ fi;
6666
# Enable frontend if configured to run
6767
if [ "${FRONTEND_ENABLED:=true}" = "true" ]; then
6868
ln ${SUPERVISOR_AVAILABLE}/20-frontend.conf ${SUPERVISOR_ENABLED}/20-frontend.conf
69-
70-
unlink /etc/nginx/nginx.conf 2>/dev/null
71-
if [ -e "${CERT}/fullchain.pem" ] && [ -e "${CERT}/privkey.pem" ]; then
72-
echo "Certificates found, starting with HTTPS."
73-
ln -s /etc/nginx/nginx-https.conf /etc/nginx/nginx.conf
74-
if [ ! -e "${CERT}/dhparam.pem" ]; then
75-
echo "Diffle-Helmann parameters file not found, generating in now... (this can take some time)"
76-
openssl dhparam -out "${CERT}/dhparam.pem" 4096
77-
fi;
78-
else
79-
echo "Certificates not found, starting with HTTP."
80-
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
81-
fi;
8269
fi;
8370

8471
# Handle CMD command

deploy/docker/frontend/01-update-nginx-conf.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
set -e
44

5+
echo "Creating nginx config..."
6+
if [ -e "${CERT}/fullchain.pem" ] && [ -e "${CERT}/privkey.pem" ]; then
7+
echo "Certificates found, configuring with HTTPS."
8+
ln -s /etc/nginx/nginx-https.conf /etc/nginx/nginx.conf
9+
if [ ! -e "${CERT}/dhparam.pem" ]; then
10+
echo "Diffle-Helmann parameters file not found, generating in now... (this can take some time)"
11+
openssl dhparam -out "${CERT}/dhparam.pem" 4096
12+
fi;
13+
else
14+
echo "Certificates not found, configuring with HTTP."
15+
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
16+
fi;
17+
518
sed -i "s@__LOWCODER_API_SERVICE_URL__@${LOWCODER_API_SERVICE_URL:=http://localhost:8080}@" /etc/nginx/nginx.conf
619
sed -i "s@__LOWCODER_NODE_SERVICE_URL__@${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}@" /etc/nginx/nginx.conf
720

0 commit comments

Comments
 (0)