Initial commit: add FastAPI MVP (모프) and existing web app
Includes FastAPI+Jinja2+HTMX+SQLite implementation with seed categories, plus deployment templates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
12
ops/Caddyfile.mopf
Normal file
12
ops/Caddyfile.mopf
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
# 인증서 발급용 이메일(서버에서 환경변수로 주는 것을 권장)
|
||||
email {$CADDY_EMAIL}
|
||||
}
|
||||
|
||||
prompt.ncue.net {
|
||||
encode zstd gzip
|
||||
|
||||
# FastAPI(uvicorn)로 리버스 프록시
|
||||
reverse_proxy 127.0.0.1:8000
|
||||
}
|
||||
|
||||
29
ops/mopf.service
Normal file
29
ops/mopf.service
Normal file
@@ -0,0 +1,29 @@
|
||||
[Unit]
|
||||
Description=모프(all prompt) FastAPI 서비스
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
WorkingDirectory=/opt/mopf
|
||||
|
||||
# venv 경로는 설치 방식에 맞게 수정
|
||||
Environment="PATH=/opt/mopf/venv/bin"
|
||||
|
||||
# DB/식별자 salt (필수는 아님, 운영에서는 salt 변경 권장)
|
||||
Environment="MOPF_DATABASE_URL=sqlite:////opt/mopf/data/all_prompt.db"
|
||||
Environment="MOPF_SALT=CHANGE_ME_TO_RANDOM_STRING"
|
||||
|
||||
# uvicorn을 main.py 내부에서 실행하므로 python main.py로 실행
|
||||
ExecStart=/opt/mopf/venv/bin/python /opt/mopf/main.py
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
|
||||
# 로그는 journalctl로 확인
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user