add: dockerfile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ __pycache__
|
||||
.env
|
||||
skins
|
||||
capes
|
||||
mongodb
|
||||
|
@ -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
29
docker-compose.yml
Normal 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
16
dockerfile
Normal 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"]
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user