Skip to content

Move frontend configuration to it's entrypoint #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ RUN yarn build
FROM nginx:1.23.4 as lowcoder-ce-frontend
LABEL maintainer="lowcoder"

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

# Copy lowcoder client data
COPY --chown=lowcoder:lowcoder --from=build-client /lowcoder-client/packages/lowcoder/build/ /lowcoder/client
Expand Down
13 changes: 0 additions & 13 deletions deploy/docker/all-in-one/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,6 @@ fi;
# Enable frontend if configured to run
if [ "${FRONTEND_ENABLED:=true}" = "true" ]; then
ln ${SUPERVISOR_AVAILABLE}/20-frontend.conf ${SUPERVISOR_ENABLED}/20-frontend.conf

unlink /etc/nginx/nginx.conf 2>/dev/null
if [ -e "${CERT}/fullchain.pem" ] && [ -e "${CERT}/privkey.pem" ]; then
echo "Certificates found, starting with HTTPS."
ln -s /etc/nginx/nginx-https.conf /etc/nginx/nginx.conf
if [ ! -e "${CERT}/dhparam.pem" ]; then
echo "Diffle-Helmann parameters file not found, generating in now... (this can take some time)"
openssl dhparam -out "${CERT}/dhparam.pem" 4096
fi;
else
echo "Certificates not found, starting with HTTP."
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
fi;
fi;

# Handle CMD command
Expand Down
13 changes: 13 additions & 0 deletions deploy/docker/frontend/01-update-nginx-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

set -e

echo "Creating nginx config..."
if [ -e "${CERT}/fullchain.pem" ] && [ -e "${CERT}/privkey.pem" ]; then
echo "Certificates found, configuring with HTTPS."
ln -s /etc/nginx/nginx-https.conf /etc/nginx/nginx.conf
if [ ! -e "${CERT}/dhparam.pem" ]; then
echo "Diffle-Helmann parameters file not found, generating in now... (this can take some time)"
openssl dhparam -out "${CERT}/dhparam.pem" 4096
fi;
else
echo "Certificates not found, configuring with HTTP."
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
fi;

sed -i "s@__LOWCODER_API_SERVICE_URL__@${LOWCODER_API_SERVICE_URL:=http://localhost:8080}@" /etc/nginx/nginx.conf
sed -i "s@__LOWCODER_NODE_SERVICE_URL__@${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}@" /etc/nginx/nginx.conf

Expand Down