Skip to content

Commit

Permalink
Updated dockerfile to be more verbose, adding helxui user and group
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-seals committed Sep 18, 2023
1 parent f6c1c6c commit 6f04972
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ ENV REACT_APP_WORKSPACES_ENABLED=$REACT_APP_WORKSPACES_ENABLED
# Copy and install requirements
WORKDIR /usr/src/app
COPY --chown=node:node "package*.json" /usr/src/app/
RUN npm i -g npm@latest
RUN npm ci
RUN npm install -g npm@latest
RUN npm clean-install

COPY --chown=node:node . /usr/src/app
RUN npm run build
Expand All @@ -20,18 +20,18 @@ RUN npm run build
########################

FROM nginx:1.25.1-alpine-slim
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /usr/src/app/build/ /usr/share/nginx/static/
# RUN mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/

RUN apk upgrade
RUN apk add bash
# Ensure a rootless container
RUN addgroup -g 1000 -S helxui && \
adduser -u 1000 -h /helxui -G helxui -S helxui

WORKDIR /usr/src/app
COPY bin /usr/src/app/bin
COPY --chown=helxui:helxui nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --chown=helxui:helxui nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder --chown=helxui:helxui /usr/src/app/build/ /usr/share/nginx/static/
COPY --chown=helxui:helxui bin /usr/src/app/bin
ENV PATH="/usr/src/app/bin:${PATH}"

# RUN mv /usr/share/nginx/static/frontend/index.html /usr/share/nginx/html/
WORKDIR /usr/src/app

EXPOSE 80
CMD ["start_server", "/usr/share/nginx/static/frontend/env.json"]

0 comments on commit 6f04972

Please sign in to comment.