Skip to content

Commit b90e745

Browse files
committed
feat: add Dockerfile and .dockerignore for containerization
1 parent 491893f commit b90e745

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
.nx
3+
node_modules
4+
dist
5+
target
6+
apps/**/dist
7+
apps/**/target
8+
**/*.log
9+
**/*.rs.bk

.github/workflows/build-docker.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Build Docker image
14+
run: docker build -t webhook-router .

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM rust:1.82-bookworm AS build
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
ca-certificates \
6+
nodejs \
7+
npm \
8+
pkg-config \
9+
libsqlite3-dev \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
RUN npm install -g pnpm@10
13+
14+
WORKDIR /repo
15+
COPY . .
16+
17+
RUN pnpm install --frozen-lockfile
18+
RUN pnpm exec nx build webhook_router --configuration=production
19+
20+
FROM debian:bookworm-slim AS runtime
21+
22+
RUN apt-get update \
23+
&& apt-get install -y --no-install-recommends \
24+
ca-certificates \
25+
libsqlite3-0 \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
WORKDIR /app
29+
COPY --from=build /repo/dist/target/webhook_router/release/webhook_router /app/webhook_router
30+
31+
EXPOSE 3000
32+
ENTRYPOINT ["/app/webhook_router"]

0 commit comments

Comments
 (0)