-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 992 Bytes
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 992 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
FROM oven/bun:1 AS builder
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
ENV NODE_ENV production
RUN bun run build && \
test -d dist && test -f dist/index.html && \
bun pm cache clean && rm -rf src test && \
find dist -type f \( \
-name "*.html" -o \
-name "*.css" -o \
-name "*.js" -o \
-name "*.json" -o \
-name "*.xml" -o \
-name "*.txt" -o \
-name "*.svg" \
\) -exec sh -c 'gzip -9 "{}"' \;
# ==============================================================================
# Production Stage - Using lipanski/docker-static-website for extreme minimal footprint (92.5 KB base)
# ==============================================================================
FROM lipanski/docker-static-website:latest AS runner
# Copy built assets from builder stage
# lipanski/docker-static-website serves from /home/static
COPY --from=builder /app/dist /home/static
# Expose port (BusyBox httpd uses port 3000 by default)
EXPOSE 3000