Skip to content

Commit c15aef4

Browse files
committed
infra: Change deployment setup
1 parent 5c8919e commit c15aef4

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:20-alpine
2+
3+
RUN npm install -g pnpm
4+
5+
WORKDIR /app
6+
7+
COPY package.json pnpm-lock.yaml ./
8+
9+
RUN pnpm install --frozen-lockfile
10+
11+
COPY prisma ./prisma/
12+
13+
RUN pnpm exec prisma generate
14+
15+
COPY . .
16+
17+
RUN pnpm run build
18+
19+
EXPOSE 8020
20+
21+
CMD ["pnpm", "start"]

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
tags:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
restart: unless-stopped
7+
environment:
8+
- DATABASE_URL=${DATABASE_URL}
9+
- DISCORD_APP_ID=${DISCORD_APP_ID}
10+
- DISCORD_PUBLIC_KEY=${DISCORD_PUBLIC_KEY}
11+
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
12+
- PORT=8020
13+
networks:
14+
- caddy
15+
labels:
16+
caddy_0: tags.b1.buape.com
17+
caddy_0.reverse_proxy: "{{upstreams 8020}}"
18+
19+
networks:
20+
caddy:
21+
external: true

0 commit comments

Comments
 (0)