-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 1.05 KB
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
43
44
45
46
47
48
# Build stage
FROM oven/bun:1 AS builder
WORKDIR /app
# Copy package files
COPY package.json ./
COPY bun.lock* ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build the application
RUN bun run build
# Production stage
FROM oven/bun:1-slim
LABEL org.opencontainers.image.source="https://github.com/MBeggiato/loggator"
LABEL org.opencontainers.image.description="Docker Log Aggregator with Meilisearch - Real-time log collection and search"
LABEL org.opencontainers.image.licenses="MIT"
WORKDIR /app
# Copy built application
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./
COPY --from=builder /app/bun.lock* ./
# Install production dependencies only
RUN bun install --production
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/status || exit 1
# Start the application
ENV NODE_ENV=production
ENV PORT=3000
ENV HOST=0.0.0.0
CMD ["node", "build/index.js"]