-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (25 loc) · 839 Bytes
/
Dockerfile
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
FROM node:lts
LABEL maintainer="MAgungHKM"
# # Install required packages
# RUN apt-get update --yes && \
# apt-get install --yes --no-install-recommends openssl libssl1.1 libssl-dev libc6 libc-dev && \
# rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy source code
COPY --chown=node:node package.json pnpm-lock.yaml ./
# Running npm install
RUN npm install -g pnpm fastify-cli
RUN pnpm install --frozen-lockfile --ignore-scripts
# Copy the rest of your app's source code from your host to your image filesystem.
COPY --chown=node:node . .
RUN sed -i 's/localhost/postgres/g' .env
# build app
RUN pnpx prisma generate
RUN pnpm build:ts
# Switch to 'node' user
USER node
# Open the mapped port
EXPOSE 3000
CMD ["fastify", "start", "-l", "info", "dist/app.js"]
# ENTRYPOINT ["tail", "-f", "/dev/null"]