Steve/EV Dashboard/nginx 도커파일 및 설정파일 추가
This commit is contained in:
35
ev-charging-backend/.env
Normal file
35
ev-charging-backend/.env
Normal file
@@ -0,0 +1,35 @@
|
||||
# ── 데이터베이스 ──
|
||||
POSTGRES_DB=ev_charging
|
||||
POSTGRES_USER=evuser
|
||||
POSTGRES_PASSWORD=evpass1234
|
||||
POSTGRES_HOST=postgres
|
||||
POSTGRES_PORT=5432
|
||||
|
||||
# ── Redis ──
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
|
||||
# ── Steve OCPP 서버 ──
|
||||
STEVE_BASE_URL=https://s1.byunc.com/steve
|
||||
STEVE_API_USER=admin
|
||||
STEVE_API_PASSWORD=changeme
|
||||
|
||||
# ── 토스페이먼츠 ──
|
||||
TOSS_CLIENT_KEY=test_ck_Poxy1XQL8RYmzR9JgL5lr7nO5Wml
|
||||
TOSS_SECRET_KEY=test_sk_ZLKGPx4M3M90lvAvzx1n3BaWypv1
|
||||
#TOSS_CLIENT_KEY=test_ck_xxxxxxxxxx
|
||||
#TOSS_SECRET_KEY=test_sk_xxxxxxxxxx
|
||||
|
||||
# ── 요금 설정 (원/kWh) ──
|
||||
ELECTRICITY_RATE=120
|
||||
SERVICE_MARGIN=50
|
||||
|
||||
# ── JWT ──
|
||||
JWT_SECRET=your-super-secret-key-change-this
|
||||
JWT_ALGORITHM=HS256
|
||||
JWT_EXPIRE_MINUTES=1440
|
||||
|
||||
# ── 서버 ──
|
||||
SERVER_HOST=0.0.0.0
|
||||
SERVER_PORT=8000
|
||||
DEBUG=true
|
||||
15
ev-charging-backend/Dockerfile
Normal file
15
ev-charging-backend/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
# 시스템 패키지
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc libpq-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY ./app /code/app
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
10
ev-charging-backend/Dockerfile.proxy
Executable file
10
ev-charging-backend/Dockerfile.proxy
Executable file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
RUN pip install --no-cache-dir websockets aiohttp
|
||||
|
||||
COPY entrypoint-proxy.sh /code/
|
||||
RUN chmod +x /code/entrypoint-proxy.sh
|
||||
|
||||
CMD ["/code/entrypoint-proxy.sh"]
|
||||
84
ev-charging-backend/docker-compose.yml
Normal file
84
ev-charging-backend/docker-compose.yml
Normal file
@@ -0,0 +1,84 @@
|
||||
services:
|
||||
# ── FastAPI 백엔드 ──
|
||||
api:
|
||||
build: .
|
||||
container_name: ev-api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ./app:/code/app
|
||||
- ./dashboard.html:/code/dashboard.html:ro
|
||||
- ./simulator.html:/code/simulator.html:ro
|
||||
networks:
|
||||
- ev-net
|
||||
|
||||
# ── OCPP 프록시 서버 ──
|
||||
proxy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.proxy
|
||||
container_name: ev-proxy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9002:9002"
|
||||
- "9003:9003"
|
||||
volumes:
|
||||
- ./ocpp_proxy_server.py:/code/ocpp_proxy_server.py:ro
|
||||
- ./proxy_control.html:/code/proxy_control.html:ro
|
||||
- proxy_logs:/code/ocpp_logs
|
||||
- proxy_config:/code/config
|
||||
networks:
|
||||
- ev-net
|
||||
|
||||
# ── PostgreSQL ──
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: ev-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-ev_charging}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-evuser}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-evpass1234}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-evuser}"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
networks:
|
||||
- ev-net
|
||||
|
||||
# ── Redis ──
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: ev-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6375:6379"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
networks:
|
||||
- ev-net
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
proxy_logs:
|
||||
proxy_config:
|
||||
|
||||
networks:
|
||||
ev-net:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user