mirror of
https://github.com/suitenumerique/meet.git
synced 2026-10-14 09:01:21 +00:00
b723b7bb62
Incorrect file permissions in the frontend Docker image caused problems when running the project, and were surfaced by @briquet while setting it up with Podman. Adjust the ownership and permissions applied during the build so the image works cleanly under Docker and Podman alike.
65 lines
1.3 KiB
Docker
65 lines
1.3 KiB
Docker
FROM node:22-alpine AS frontend-deps
|
|
|
|
USER node
|
|
|
|
WORKDIR /home/frontend/
|
|
|
|
COPY --chown=node:node ./src/frontend/package.json ./package.json
|
|
COPY --chown=node:node ./src/frontend/package-lock.json ./package-lock.json
|
|
|
|
RUN npm ci
|
|
|
|
COPY --chown=node:node .dockerignore ./.dockerignore
|
|
COPY --chown=node:node ./src/frontend/ .
|
|
|
|
### ---- Front-end builder image ----
|
|
FROM frontend-deps AS meet
|
|
|
|
WORKDIR /home/frontend
|
|
|
|
FROM frontend-deps AS meet-dev
|
|
|
|
USER node
|
|
|
|
WORKDIR /home/frontend
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD [ "npm", "run", "dev"]
|
|
|
|
# Tilt will rebuild Meet target so, we dissociate meet and meet-builder
|
|
# to avoid rebuilding the app at every changes.
|
|
FROM meet AS meet-builder
|
|
|
|
WORKDIR /home/frontend
|
|
|
|
ARG VITE_API_BASE_URL
|
|
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
|
|
|
ARG VITE_APP_TITLE
|
|
ENV VITE_APP_TITLE=${VITE_APP_TITLE}
|
|
|
|
RUN npm run build
|
|
|
|
# ---- Front-end image ----
|
|
FROM nginxinc/nginx-unprivileged:1.30.4-alpine3.24 AS frontend-production
|
|
|
|
USER root
|
|
RUN apk del curl
|
|
USER nginx
|
|
|
|
# Un-privileged user running the application
|
|
ARG DOCKER_USER
|
|
USER ${DOCKER_USER}
|
|
|
|
COPY --from=meet-builder \
|
|
/home/frontend/dist \
|
|
/usr/share/nginx/html
|
|
|
|
COPY ./src/frontend/default.conf /etc/nginx/conf.d
|
|
COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint
|
|
|
|
ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|