chore: add Dockerfile, docker-compose.yml, .dockerignore

Made-with: Cursor
This commit is contained in:
21in7
2026-03-01 16:07:20 +09:00
parent 3d05806155
commit 60b32a978e
3 changed files with 44 additions and 0 deletions

11
.dockerignore Normal file
View File

@@ -0,0 +1,11 @@
.env
.venv
__pycache__
*.pyc
*.pyo
.pytest_cache
logs/
*.log
.git
docs/
tests/

19
Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p logs
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
CMD ["python", "main.py"]

14
docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
services:
cointrader:
build: .
container_name: cointrader
restart: unless-stopped
env_file:
- .env
volumes:
- ./logs:/app/logs
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"