-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (30 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
34 lines (30 loc) · 1.07 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
FROM oven/bun:1.2 AS base
# skia-canvas deps
RUN apt update && apt install libfontconfig1 -y
RUN mkdir -p /usr/src/app && chown bun:bun /usr/src/app
USER bun
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /tmp/prod /tmp/dev
# copy package.json, lockfile
COPY package.json bun.lock /tmp/prod/
COPY package.json bun.lock /tmp/dev/
# We will manually run postinstalls later
RUN cd /tmp/dev && bun i
RUN cd /tmp/prod && bun i --production
FROM base AS build
RUN echo 'AQUADX_URL=https://google.com/' > .env
COPY . .
COPY --from=install /tmp/dev/node_modules node_modules
# At the time of writing, vite fails to transform modules if the AQUADX_URL
# private dynamic var is missing despite the fact that it is
# a private dynamic var. This variable, regardless, does not appear
# in the actual build. I should probably file a bug report for this
# eventually.
RUN NODE_ENV=production bun run --bun build
FROM base AS release
COPY package.json .
COPY --from=install /tmp/prod/node_modules node_modules
COPY --from=build /usr/src/app/build build
EXPOSE 3000/tcp
CMD ["bun", "run", "./build"]