-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.tasks
45 lines (34 loc) · 1.04 KB
/
Dockerfile.tasks
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
41
42
43
44
45
FROM node:20.18.0 as build
ENV NEXT_TELEMETRY_DISABLED 1
ARG WS="@helpwave/tasks"
# install pnpm
RUN npm install --global pnpm@8
WORKDIR /web
# copy all dependency declarations inside the container
COPY package.json .
COPY pnpm-lock.yaml .
COPY pnpm-workspace.yaml .
COPY lib/package.json ./lib/
COPY tasks/package.json ./tasks/
COPY api-services/package.json ./api-services/
# install dependencies
RUN CI=1 pnpm install
# build tasks app
COPY lib ./lib/
COPY tasks ./tasks/
COPY api-services ./api-services/
RUN pnpm --filter $WS run build
FROM node:20.18.0-alpine
LABEL maintainer="tech@helpwave.de"
ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /web
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# copy transpiled app
COPY --from=build --chown=nextjs:nodejs /web/tasks/build/standalone ./
COPY --from=build --chown=nextjs:nodejs /web/tasks/public ./tasks/public
COPY --from=build --chown=nextjs:nodejs /web/tasks/build/static ./tasks/build/static
EXPOSE 80
ENV PORT 80
ENV HOSTNAME 0.0.0.0
CMD ["node", "tasks/server.js"]