forked from seerr-team/seerr
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (43 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (43 loc) · 1.32 KB
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
55
56
57
58
59
FROM oven/bun:1.4.1-alpine AS base
USER root
ARG SOURCE_DATE_EPOCH
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
WORKDIR /app
COPY . .
FROM base AS prod-deps
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
CI=true bun install --production --frozen-lockfile
RUN if [ -d node_modules ]; then \
find node_modules -type d \( \
-path "*ace-builds/src-noconflict" -o \
-path "*ace-builds/src" -o \
-path "*ace-builds/src-min" -o \
-path "*country-flag-icons/react" -o \
-path "*country-flag-icons/string" -o \
-path "*country-flag-icons/1x1" -o \
-path "*@heroicons/react/16" \
\) -exec rm -rf {} + || true; \
fi
FROM base AS build
ARG COMMIT_TAG
ENV COMMIT_TAG=${COMMIT_TAG}
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
CYPRESS_INSTALL_BINARY=0 bun install --frozen-lockfile
RUN bun run build
FROM oven/bun:1.4.1-alpine
USER root
ARG SOURCE_DATE_EPOCH
ARG COMMIT_TAG
ENV NODE_ENV=production
ENV COMMIT_TAG=${COMMIT_TAG}
RUN apk add --no-cache tzdata
USER bun:bun
WORKDIR /app
COPY --chown=bun:bun . .
COPY --chown=bun:bun --from=prod-deps /app/node_modules ./node_modules
COPY --chown=bun:bun --from=build /app/dist ./dist
RUN touch config/DOCKER && \
echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json
EXPOSE 5055
CMD [ "bun", "dist/launcher.js" ]