forked from varthe/Redirecterr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 901 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 901 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
# -- Build Stage --
FROM oven/bun:1.2-alpine AS build
WORKDIR /app
# Copy dependency manifests
COPY package.json bun.lock* ./
# Install ALL dependencies (including devDependencies for testing/build)
RUN bun install --frozen-lockfile
# Copy the rest of the source
COPY . .
# -- Final Stage --
FROM oven/bun:1.2-alpine AS release
WORKDIR /app
# Copy production dependencies only
COPY --from=build /app/package.json /app/bun.lock* ./
RUN bun install --production --frozen-lockfile
# Copy the source code
COPY --from=build /app/src ./src
# Create logs and config directories with correct permissions
RUN mkdir -p /logs /config && \
chown -R bun:bun /logs /config /app
# Use the non-root user 'bun' provided by the base image
USER bun
EXPOSE 8481
# Persist logs and config
VOLUME ["/logs", "/config"]
# Start the application
CMD ["bun", "run", "src/main.ts", "/logs", "/config/config.yaml"]