Deployment¶
๋ฐฐํฌ¶
Docker / ๋์ปค¶
Quick Start / ๋น ๋ฅธ ์์¶
docker build -t salmalm .
docker run -p 18800:18800 \
-e ANTHROPIC_API_KEY=sk-ant-... \
-e SALMALM_BIND=0.0.0.0 \
salmalm
Docker Compose / ๋์ปค ์ปดํฌ์ฆ¶
# Edit docker-compose.yml with your API keys
# docker-compose.yml์ API ํค๋ฅผ ์
๋ ฅํ์ธ์
docker-compose up -d
version: "3.8"
services:
salmalm:
build: .
ports:
- "127.0.0.1:18800:18800"
- "127.0.0.1:18801:18801"
volumes:
- ./data/memory:/app/memory
- ./data/workspace:/app/workspace
- ./data/uploads:/app/uploads
- ./data/plugins:/app/plugins
environment:
- SALMALM_BIND=0.0.0.0
# - ANTHROPIC_API_KEY=sk-...
restart: unless-stopped
Dockerfile¶
FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir salmalm cryptography
RUN mkdir -p memory workspace uploads plugins
EXPOSE 18800 18801
ENV SALMALM_PORT=18800
ENV PYTHONUNBUFFERED=1
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:18800/api/health')" || exit 1
ENTRYPOINT ["python3", "-m", "salmalm"]
systemd¶
Create /etc/systemd/system/salmalm.service:
/etc/systemd/system/salmalm.service ํ์ผ์ ์์ฑํ์ธ์:
[Unit]
Description=SalmAlm Personal AI Gateway
After=network.target
[Service]
Type=simple
User=salmalm
WorkingDirectory=/opt/salmalm
EnvironmentFile=/opt/salmalm/.env
ExecStart=/usr/bin/python3 -m salmalm start
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable salmalm
sudo systemctl start salmalm
sudo systemctl status salmalm
Cloud Deployment / ํด๋ผ์ฐ๋ ๋ฐฐํฌ¶
AWS EC2¶
# 1. Launch Ubuntu 22.04+ instance / EC2 ์ธ์คํด์ค ์คํ
# 2. Install Python 3.10+ / ํ์ด์ฌ ์ค์น
sudo apt update && sudo apt install -y python3 python3-pip
# 3. Install SalmAlm / SalmAlm ์ค์น
pip install salmalm[crypto]
# 4. Configure / ์ค์
cp .env.example .env
nano .env # Add API keys / API ํค ์ถ๊ฐ
# 5. Start with systemd / systemd๋ก ์์
sudo systemctl start salmalm
Railway / Render / Fly.io¶
These platforms support Docker deployments. Use the provided Dockerfile.
์ด ํ๋ซํผ๋ค์ Docker ๋ฐฐํฌ๋ฅผ ์ง์ํฉ๋๋ค. ์ ๊ณต๋ Dockerfile์ ์ฌ์ฉํ์ธ์.
Set environment variables in the platform dashboard.
ํ๋ซํผ ๋์๋ณด๋์์ ํ๊ฒฝ๋ณ์๋ฅผ ์ค์ ํ์ธ์.
Reverse Proxy (Nginx) / ๋ฆฌ๋ฒ์ค ํ๋ก์¶
server {
listen 443 ssl;
server_name ai.example.com;
ssl_certificate /etc/letsencrypt/live/ai.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ai.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:18800;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Security Considerations / ๋ณด์ ๊ณ ๋ ค์ฌํญ¶
Production Checklist / ํ๋ก๋์ ์ฒดํฌ๋ฆฌ์คํธ
- Always use HTTPS in production / ํ๋ก๋์ ์์ ํญ์ HTTPS ์ฌ์ฉ
- Set
SALMALM_BIND=127.0.0.1behind reverse proxy / ๋ฆฌ๋ฒ์ค ํ๋ก์ ๋ค์์ ๋ฐ์ธ๋ ์ฃผ์ ์ค์ - Set vault password (
SALMALM_VAULT_PW) / ๋ณผํธ ๋น๋ฐ๋ฒํธ ์ค์ - Use firewall rules / ๋ฐฉํ๋ฒฝ ๊ท์น ์ฌ์ฉ
- Regular backups of
memory/,*.db,.vault.enc/ ์ ๊ธฐ ๋ฐฑ์