-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
40 lines (27 loc) · 854 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
39
40
# Builder: build Vite + TS app
FROM oven/bun:alpine AS builder
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 lyrprep && \
adduser -D -u 1001 -G lyrprep lyrprep
COPY --chown=lyrprep:lyrprep package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY --chown=lyrprep:lyrprep . .
RUN chown -R lyrprep:lyrprep /app
USER lyrprep
RUN bun run build
# Runtime: run preview server
FROM oven/bun:alpine AS runtime
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 lyrprep && \
adduser -D -u 1001 -G lyrprep lyrprep
# Copy ALL source files from builder
COPY --from=builder --chown=lyrprep:lyrprep /app/. ./
# Install ALL dependencies including devDependencies
# Vite preview needs vite, typescript, and plugins
ENV NODE_ENV=development
RUN bun install --frozen-lockfile
USER lyrprep
EXPOSE 3000
CMD ["bun", "run", "start"]