-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 1014 Bytes
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 1014 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
FROM oven/bun:1-alpine AS base
LABEL org.opencontainers.image.source="https://github.com/karasevm/personal-gallery-node"
WORKDIR /app
FROM base AS frontend-build
COPY ./ /app
RUN bun install --filter web --frozen-lockfile
RUN bun web-build
FROM base
COPY ./ /app
RUN bun --version\
&& bun install --frozen-lockfile --production --filter server\
&& bun --filter server build \
&& rm -rf /var/lib/apt/lists/*
ARG TARGETARCH
RUN apk add --no-cache xz curl tar \
&& if [ "$TARGETARCH" = "arm64" ]; then ARCH="arm64"; else ARCH="amd64"; fi \
&& curl -L "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ARCH}-static.tar.xz" \
| tar xJ --strip-components=1 -C /usr/local/bin --wildcards '*/ffmpeg' \
&& chmod +x /usr/local/bin/ffmpeg
COPY --from=frontend-build /app/packages/web/build /app/packages/server/public
VOLUME ["/images", "/db", "/cache"]
ENV IMAGE_DIR="/images"
ENV DB_DIR="/db"
ENV PORT=80
EXPOSE 80
ENTRYPOINT [ "bun", "/app/packages/server/dist/server.js" ]