Skip to content

Commit 75a9caa

Browse files
committed
feat: Add Docker support for client service with Nginx configuration and update README for setup instructions
1 parent 8074878 commit 75a9caa

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@
4343
### 保守
4444
- **Renovate** - 依存関係の自動更新
4545

46+
## セットアップ
47+
48+
### Docker Compose (推奨)
49+
50+
```bash
51+
# 起動
52+
docker compose up --build
53+
54+
# アクセス
55+
# - フロントエンド: http://localhost:3000
56+
# - バックエンド API: http://localhost:8000
57+
```
58+
59+
### ローカル開発
60+
61+
```bash
62+
# フロントエンド
63+
cd client
64+
bun install
65+
bun dev
66+
67+
# バックエンド
68+
cd backend
69+
pip install -r requirements.txt
70+
make dev
71+
```
72+
4673
## エフェクト一覧
4774

4875
| カテゴリ | エフェクト |

client/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Build stage
2+
FROM oven/bun:1-alpine AS build
3+
WORKDIR /app
4+
COPY package.json bun.lock ./
5+
RUN bun install --frozen-lockfile
6+
COPY . .
7+
RUN bun run build
8+
9+
# Production stage
10+
FROM nginx:alpine
11+
COPY --from=build /app/dist /usr/share/nginx/html
12+
COPY nginx.conf /etc/nginx/conf.d/default.conf
13+
EXPOSE 80

client/nginx.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
# SPA routing
8+
location / {
9+
try_files $uri $uri/ /index.html;
10+
}
11+
12+
# API proxy
13+
location /api/ {
14+
proxy_pass http://backend:8000/;
15+
proxy_set_header Host $host;
16+
proxy_set_header X-Real-IP $remote_addr;
17+
}
18+
19+
# Cache static assets
20+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
21+
expires 1y;
22+
add_header Cache-Control "public, immutable";
23+
}
24+
}

compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
services:
2+
client:
3+
build:
4+
context: ./client
5+
dockerfile: Dockerfile
6+
ports:
7+
- "3000:80"
8+
depends_on:
9+
- backend
10+
211
backend:
312
build:
413
context: ./backend

0 commit comments

Comments
 (0)