-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 918 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 918 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
# --------------------------------------------------------
# Stage 1: BUILD
# --------------------------------------------------------
FROM dart:stable AS build
WORKDIR /app
# Copy pubspec first (for layer caching)
COPY pubspec.yaml ./
RUN dart pub get
# Copy source code
COPY . .
# Compile to native binary
RUN dart compile exe bin/dhook.dart -o dhook-server
# --------------------------------------------------------
# Stage 2: RUNTIME (Minimal)
# --------------------------------------------------------
FROM debian:stable-slim
# Install SSL certificates, curl, and SQLite
RUN apt-get update && apt-get install -y ca-certificates curl sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy only the compiled binary from build stage
COPY --from=build /app/dhook-server /app/dhook-server
# Expose port
EXPOSE 3000
# Run the server
ENTRYPOINT ["./dhook-server", "server", "--port", "3000"]