Skip to content

Commit f33a368

Browse files
committed
add Containerfile
1 parent fb2b673 commit f33a368

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

web/Containerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Context is ..
2+
FROM oven/bun:1-debian AS base
3+
WORKDIR /src
4+
5+
# Install deps
6+
COPY package.json bun.lock ./
7+
COPY backend/package.json backend/package.json
8+
COPY mclib/package.json mclib/package.json
9+
COPY cli/package.json cli/package.json
10+
COPY web/package.json web/package.json
11+
RUN --mount=type=cache,target=/root/.bun/install/cache bun install --filter=web
12+
13+
# Copy project
14+
COPY web/ web/
15+
COPY mclib/ mclib/
16+
17+
# Build project
18+
WORKDIR /src/web
19+
RUN bun run build
20+
21+
# To allow copying only the build output
22+
FROM scratch AS assets
23+
COPY --from=base /src/web/build /
24+
25+
# Final stage, serve with nginx
26+
FROM nginx AS final
27+
COPY --from=assets / /usr/share/nginx/html
28+
EXPOSE 80

0 commit comments

Comments
 (0)