Build ui for prod
This commit is contained in:
@@ -1,6 +1,30 @@
|
||||
FROM node:18-alpine AS ui-builder
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /builder
|
||||
|
||||
COPY ui/ ./
|
||||
RUN ls
|
||||
RUN \
|
||||
pwd && \
|
||||
if [ -f package.json ]; then \
|
||||
npm i && \
|
||||
npm run build; \
|
||||
else \
|
||||
echo "package.json not found." && \
|
||||
exit 2; \
|
||||
fi
|
||||
|
||||
FROM nginx
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY templates/ /templates/
|
||||
COPY scripts/01-configure_ssh.sh /docker-entrypoint.d/01-configure_ssh.sh
|
||||
ARG environment
|
||||
ENV environment=${environment}
|
||||
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx/templates/ /templates/
|
||||
COPY nginx/scripts/01-configure_ssh.sh /docker-entrypoint.d/01-configure_ssh.sh
|
||||
|
||||
COPY --from=ui-builder /builder/dist /dist
|
||||
RUN echo "Copying UI assets into nginx html folder..."; \
|
||||
mkdir -p /usr/share/nginx/html && \
|
||||
cp -R /dist/* /usr/share/nginx/html;
|
||||
|
||||
RUN chmod +x /docker-entrypoint.d/01-configure_ssh.sh
|
||||
|
||||
Reference in New Issue
Block a user