-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile.fe
40 lines (28 loc) · 935 Bytes
/
Dockerfile.fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM node:20-alpine
RUN npm i -g pnpm
ENV NODE_ENV production
# RUN addgroup -g 1001 -S nodejs
# RUN adduser -S nextjs -u 1001
WORKDIR /app
# pnpm fetch does require only lockfile
COPY patches ./patches
COPY pnpm-lock.yaml .npmrc ./
RUN pnpm fetch --prod
COPY package.json pnpm-workspace.yaml ./
COPY /frontend/package.json /app/frontend/
#COPY /frontend /app/frontend
# As we're going to deploy, we want only the minimal production dependencies.
# TODO
RUN pnpm install --frozen-lockfile --prod
#RUN --mount=type=cache,target=/root/.pnpm pnpm_CACHE_FOLDER=/root/.pnpm pnpm install --frozen-lockfile --prod
COPY /frontend/.output /app/frontend/.output
WORKDIR /app/frontend
# USER nextjs
EXPOSE 4000
ENV PORT=4000
ENV TZ=Europe/Berlin
ARG FE_VERSION
ENV FE_VERSION=${FE_VERSION:-docker_default}
ENV NUXT_PUBLIC_FE_VERSION=${FE_VERSION:-docker_default}
ENV SENTRY_RELEASE=${FE_VERSION:-docker_default}
CMD ["pnpm", "start"]