-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.static
More file actions
21 lines (21 loc) · 879 Bytes
/
Dockerfile.static
File metadata and controls
21 lines (21 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use an official Python runtime as a parent image
FROM node:22-bookworm-slim
# Vite/esbuild ship prebuilt binaries, so we no longer need python/make/gcc
# for native node-gyp builds. We still need gosu for the dev entrypoint
# that drops privileges to the `application` user.
RUN apt-get update && apt-get install -y \
gosu \
&& rm -rf /var/lib/apt/lists/*
# we do not want node to run as id 1000
RUN groupmod -g 999 node && usermod -u 999 -g 999 node
RUN useradd --create-home application
USER application
COPY --chown=application chat /opt/application
WORKDIR /opt/frontend
ENV FRONTEND_ASSSET_ROOT_DIR /opt/application/static
RUN cd /opt/application/frontend; npm install
RUN cd /opt/application/frontend; npm run build
COPY docker-entrypoint-static.sh /opt/docker-entrypoint-static.sh
USER root
ENTRYPOINT ["/opt/docker-entrypoint-static.sh"]
CMD ["npm", "run", "dev"]