-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
54 lines (43 loc) · 1.4 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -- BUILDER
FROM node:22.9.0-bullseye-slim as builder
WORKDIR /usr/src/app
# Install dependencies
COPY . .
RUN yarn install
# Build project
RUN yarn prisma generate
RUN yarn build
# -- RUNNER
FROM node:22.9.0-bullseye-slim AS base
WORKDIR /usr/src/app
ENV NODE_ENV=production
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
# Update apt and install security updates
RUN apt update && \
apt upgrade -y && \
apt install -y ca-certificates && \
apt clean
# Install wget
RUN apt install -y wget xz-utils
# Download and install ffmpeg based on the architecture
# More files can be found here : https://johnvansickle.com/ffmpeg/
RUN if [ "$(uname -m)" = "x86_64" ]; then \
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -O ffmpeg.tar.xz; \
else \
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz -O ffmpeg.tar.xz; \
fi && \
tar xJf ffmpeg.tar.xz --strip-components=1 -C /usr/local/bin && \
rm ffmpeg.tar.xz
# Install production-only dependencies (this will ignore devDependencies)
COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn install --production --ignore-optional
# Playwright's dependencies
RUN yarn playwright install-deps
RUN yarn add @playwright/browser-chromium
# Copy project specific files
COPY --from=builder /usr/src/app/dist ./dist
COPY ./prisma ./prisma
# Generate Prisma
RUN yarn prisma generate
CMD yarn start