Skip to content

Commit c6d018c

Browse files
updated Dockerfile to add separate lowcoder-ee-frontend image
1 parent 3ca7794 commit c6d018c

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

deploy/docker/Dockerfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,84 @@ EXPOSE 3443
185185

186186
#############################################################################
187187

188+
##
189+
## Build lowcoder client (Enterprise) application
190+
##
191+
FROM node:20.2-slim AS build-client-ee
192+
193+
# curl is required for yarn build to succeed, because it calls it while building client
194+
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
195+
196+
# Build client
197+
COPY ./client /lowcoder-client-ee
198+
WORKDIR /lowcoder-client-ee
199+
RUN yarn --immutable
200+
201+
ARG REACT_APP_COMMIT_ID=test
202+
ARG REACT_APP_ENV=production
203+
ARG REACT_APP_EDITION=community
204+
ARG REACT_APP_DISABLE_JS_SANDBOX=true
205+
RUN yarn build:ee
206+
207+
# Build lowcoder-comps
208+
WORKDIR /lowcoder-client-ee/packages/lowcoder-comps
209+
RUN yarn install
210+
RUN yarn build
211+
RUN tar -zxf lowcoder-comps-*.tgz && mv package lowcoder-comps
212+
213+
# Build lowcoder-sdk
214+
WORKDIR /lowcoder-client-ee/packages/lowcoder-sdk
215+
RUN yarn install
216+
RUN yarn build
217+
218+
WORKDIR /lowcoder-client-ee/packages/lowcoder-sdk-webpack-bundle
219+
RUN yarn install
220+
RUN yarn build
221+
222+
##
223+
## Intermediary Lowcoder client (Enterprise) image
224+
##
225+
## To create a separate image out of it, build it with:
226+
## DOCKER_BUILDKIT=1 docker build -f deploy/docker/Dockerfile -t lowcoderorg/lowcoder-ee-frontend --target lowcoder-ee-frontend .
227+
##
228+
FROM nginx:1.27.1 AS lowcoder-ee-frontend
229+
LABEL maintainer="lowcoder"
230+
231+
# Change default nginx user into lowcoder user and remove default nginx config
232+
RUN usermod --login lowcoder --uid 9001 nginx \
233+
&& groupmod --new-name lowcoder --gid 9001 nginx \
234+
&& rm -f /etc/nginx/nginx.conf \
235+
&& mkdir -p /lowcoder/assets
236+
237+
# Copy lowcoder client
238+
COPY --chown=lowcoder:lowcoder --from=build-client-ee /lowcoder-client-ee/packages/lowcoder/build/ /lowcoder/client
239+
# Copy lowcoder components
240+
COPY --chown=lowcoder:lowcoder --from=build-client-ee /lowcoder-client-ee/packages/lowcoder-comps/lowcoder-comps /lowcoder/client-comps
241+
# Copy lowcoder SDK
242+
COPY --chown=lowcoder:lowcoder --from=build-client-ee /lowcoder-client-ee/packages/lowcoder-sdk /lowcoder/client-sdk
243+
# Copy lowcoder SDK webpack bundle
244+
COPY --chown=lowcoder:lowcoder --from=build-client-ee /lowcoder-client-ee/packages/lowcoder-sdk-webpack-bundle/dist /lowcoder/client-embed
245+
246+
247+
# Copy additional nginx init scripts
248+
COPY deploy/docker/frontend/00-change-nginx-user.sh /docker-entrypoint.d/00-change-nginx-user.sh
249+
COPY deploy/docker/frontend/01-update-nginx-conf.sh /docker-entrypoint.d/01-update-nginx-conf.sh
250+
251+
RUN chmod +x /docker-entrypoint.d/00-change-nginx-user.sh && \
252+
chmod +x /docker-entrypoint.d/01-update-nginx-conf.sh
253+
254+
COPY deploy/docker/frontend/server.conf /etc/nginx/server.conf
255+
COPY deploy/docker/frontend/nginx-http.conf /etc/nginx/nginx-http.conf
256+
COPY deploy/docker/frontend/nginx-https.conf /etc/nginx/nginx-https.conf
257+
COPY deploy/docker/frontend/ssl-certificate.conf /etc/nginx/ssl-certificate.conf
258+
COPY deploy/docker/frontend/ssl-params.conf /etc/nginx/ssl-params.conf
259+
260+
261+
EXPOSE 3000
262+
EXPOSE 3444
263+
264+
#############################################################################
265+
188266
##
189267
## Build Lowcoder all-in-one image
190268
##

0 commit comments

Comments
 (0)