-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 1001 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 1001 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
FROM oven/bun:alpine AS base
# we use alpine because the default oven/bun:1 image is glibc, which doesn't do well with @jupiterpi/node-keyring
WORKDIR /filen-cli
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
COPY patches/*.patch /temp/dev/patches/
RUN cd /temp/dev && bun install --frozen-lockfile
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
COPY patches/*.patch /temp/prod/patches/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
ARG FILEN_CLI_VERSION
RUN bun build --target=bun --sourcemap --define VERSION=${FILEN_CLI_VERSION} --define IS_RUNNING_AS_CONTAINER=true src/index.ts --outdir build
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /filen-cli/build build
COPY --from=prerelease /filen-cli/package.json package.json
EXPOSE 80
ENTRYPOINT [ "bun", "run", "build/index.js" ]