-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 948 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 948 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
FROM node:20-alpine
ARG TZ
ARG NODE_ENV
ARG POSTGRESQL_URL
ENV TZ $TZ
ENV NODE_ENV $NODE_ENV
ENV POSTGRESQL_URL $POSTGRESQL_URL
WORKDIR /usr/app
RUN apk add --no-cache python3 make g++ tzdata
# Set the timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Copy package lists and install dependencies
COPY package.json yarn.lock .yarnrc.yml /usr/app
COPY .yarn /usr/app/.yarn
RUN yarn set version stable
# Install dependencies
RUN yarn install --immutable
# Copy Prisma configuration and generate the client
COPY prisma /usr/app/prisma
RUN yarn pnpify prisma generate
# Copy the rest of the files and build the app
COPY tsconfig.json tsup.config.ts /usr/app
COPY src /usr/app/src
RUN yarn build
# Start the app
# TODO: Find out why yarn is putting a cache into /root/.yarn which cannot be accessed by this user
# and why disabling global cache causes esbuild to never finish
# USER node
CMD yarn start