-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (29 loc) · 884 Bytes
/
Dockerfile
File metadata and controls
42 lines (29 loc) · 884 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
41
42
FROM oven/bun:1 AS builder
# Accept version as build argument
ARG VERSION=dev
WORKDIR /app
LABEL org.opencontainers.image.source="https://github.com/timlohrer/auth-rs"
LABEL org.opencontainers.image.authors="Tim Lohrer"
# Copy package files
COPY package.json package-lock.json bun.lockb .npmrc ./
COPY .prettierrc .prettierignore ./
# Install dependencies
RUN bun install
# Copy source code
COPY src/ ./src/
COPY static/ ./static/
COPY svelte.config.js tsconfig.json vite.config.ts ./
# Set environment variable for build
ENV VITE_VERSION=$VERSION
# Build the application
RUN bun run build
# Production stage
FROM oven/bun:1-slim
WORKDIR /app
# Copy built assets from builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./
# Expose the port the app runs on
EXPOSE 3000
# Command to run the application
CMD ["bun", "build/index.js"]