-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProduction.dockerfile
More file actions
35 lines (25 loc) · 844 Bytes
/
Copy pathProduction.dockerfile
File metadata and controls
35 lines (25 loc) · 844 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
# Build stage. Adds all the gigantic dev dependencies in order to build.
FROM node:22.23.1-alpine3.23
LABEL maintainer="tyrone@sudeium.com"
WORKDIR /app
# Rely on .dockerignore to remove irrelevant stuff
ADD . .
RUN yarn install \
&& yarn build -p tsconfig.prod.json
# Run stage. The smallest possible contents that can still run the app.
FROM node:22.23.1-alpine3.23
WORKDIR /app
ARG COMMIT_SHA=""
ENV SOURCE_VERSION=${COMMIT_SHA}
# Add ffmpeg, runtime requirement for reddit/tiktok
# NOTE: Adds ~100MB :(
# RUN apk --no-cache add ffmpeg
# Copy the built .js files from the previous stage.
COPY --from=0 /app/dist /app/dist
# Add the bare minimum files required to bootstrap the app.
COPY public ./public
COPY res ./res
COPY package.json yarn.lock ./
RUN yarn install --production \
&& yarn cache clean
CMD ["yarn", "start"]