Skip to content

Commit 01ba233

Browse files
committed
feat: docker
1 parent 9f0d9e1 commit 01ba233

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git
2+
.vscode
3+
4+
dist
5+
node_modules
6+
7+
.env
8+
.gitignore
9+
*.local
10+
*.md

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dist/
66

77
# env
88
.env
9-
.env.production
9+
*.local
1010

1111
# logs
1212
logs/

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# https://hono.dev/docs/getting-started/nodejs#dockerfile
2+
# https://pnpm.io/docker#example-1-build-a-bundle-in-a-docker-container
3+
4+
FROM node:23-alpine AS base
5+
ENV PNPM_HOME="/pnpm"
6+
ENV PATH="$PNPM_HOME:$PATH"
7+
RUN corepack enable
8+
COPY . /app
9+
WORKDIR /app
10+
11+
FROM base AS deps
12+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
13+
14+
FROM base AS dist
15+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile && \
16+
pnpm build
17+
18+
FROM base AS runner
19+
COPY --from=deps /app/node_modules /app/node_modules
20+
COPY --from=dist /app/dist /app/dist
21+
EXPOSE 1188
22+
ENTRYPOINT ["node", "/app/dist/cli.js"]

docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
arpk:
3+
build: .
4+
container_name: arpk
5+
network_mode: host
6+
restart: unless-stopped
7+
environment:
8+
- ARPK_MODEL=gemma2

0 commit comments

Comments
 (0)