add: dockerfile

This commit is contained in:
2025-07-20 23:24:00 +05:00
parent c7f6baac5d
commit e59669f66a
5 changed files with 53 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ __pycache__
.env
skins
capes
mongodb

View File

@ -2,7 +2,7 @@ from motor.motor_asyncio import AsyncIOMotorClient
from app.core.config import MONGO_URI
client = AsyncIOMotorClient(MONGO_URI)
db = client["minecraft_auth"]
db = client["minecraft-api"]
users_collection = db["users"]
sessions_collection = db["sessions"]

29
docker-compose.yml Normal file
View File

@ -0,0 +1,29 @@
services:
app:
container_name: minecraft-api
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./app/static:/app/static
environment:
- MONGO_URI=mongodb://mongodb:27017/minecraft-api
- SECRET_KEY=your-secret-key
- ALGORITHM=HS256
- ACCESS_TOKEN_EXPIRE_MINUTES=30
depends_on:
- mongodb
mongodb:
container_name: mongodb
image: mongo:latest
ports:
- "27017:27017"
volumes:
- ./mongodb:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=popa
- MONGO_INITDB_ROOT_PASSWORD=2006sit_
restart: always

16
dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
VOLUME /app/static
EXPOSE 3000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]

View File

@ -5,3 +5,9 @@ python-jose>=3.3.0
passlib>=1.7.4
bcrypt>=4.0.1
python-multipart>=0.0.9
mongoengine>=0.24.2
python-dotenv>=1.0.0
pydantic>=2.0.0
pydantic[email]>=2.0.0
cryptography>=43.0.0