-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.Dockerfile
More file actions
42 lines (29 loc) · 982 Bytes
/
Copy pathdev.Dockerfile
File metadata and controls
42 lines (29 loc) · 982 Bytes
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
FROM node:24.12.0
# TODO Make this use the non-root app user.
WORKDIR /usr/src/app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
COPY package.json pnpm-lock.yaml* ./
# Fix for the building of this
# https://github.com/orgs/pnpm/discussions/9109
# # https://github.com/pnpm/pnpm/issues/11562
RUN pnpm install --config.confirmModulesPurge=false --dangerously-allow-all-builds
COPY . .
# Generate the prisma DB.
# Not required for the Astro web server.
# RUN pnpm run generate:prisma-db
EXPOSE 3000
#-----
# Non root user
# TODO Set this up
#-----
# Use a non-root user
#RUN groupadd -r app && useradd -r -g app app && chown -R app:app /usr/src/app
#
## Setup the corepack and .next folder for proper permissions
#RUN mkdir -p /home/app/.cache/node/corepack \
# && chown -R app:app /home/app/.cache \
# && mkdir -p /usr/src/app/.next \
# && chown -R app:app /usr/src/app/.next
#USER app
CMD ["pnpm", "dev", "--hostname", "0.0.0.0"]