forked from lpbayliss/fastify-ts-rest-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (26 loc) · 807 Bytes
/
Dockerfile
File metadata and controls
39 lines (26 loc) · 807 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 debian:bullseye as builder
ARG NODE_VERSION=19.3.0
RUN apt-get update; apt install -y curl python-is-python3 pkg-config build-essential
RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH /root/.volta/bin:$PATH
RUN volta install node@${NODE_VERSION}
ENV VOLTA_FEATURE_PNPM 1
RUN volta install pnpm
#######################################################################
RUN mkdir /app
WORKDIR /app
ENV NODE_ENV production
COPY . .
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
RUN pnpm run build
FROM debian:bullseye
LABEL fly_launch_runtime="nodejs"
COPY --from=builder /root/.volta /root/.volta
COPY --from=builder /app /app
WORKDIR /app
ENV NODE_ENV production
ENV PATH /root/.volta/bin:$PATH
EXPOSE 8080
ENV PORT 8080
CMD [ "node", "dist/index.js" ]