You've already forked Promocode-API
mirror of
https://github.com/devitq/Promocode-API.git
synced 2026-05-23 22:37:11 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
README.md
|
||||
.venv/
|
||||
__pycache__/
|
||||
@@ -0,0 +1,2 @@
|
||||
.venv/
|
||||
__pycache__/
|
||||
@@ -0,0 +1,10 @@
|
||||
FROM python:3.12-alpine3.21
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "python", "./main.py" ]
|
||||
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
from fastapi import FastAPI
|
||||
import uvicorn
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/api/ping")
|
||||
def send():
|
||||
return {"status": "ok"}
|
||||
|
||||
if __name__ == "__main__":
|
||||
server_address = os.getenv("SERVER_ADDRESS", "0.0.0.0:8080")
|
||||
host, port = server_address.split(":")
|
||||
uvicorn.run(app, host=host, port=int(port))
|
||||
@@ -0,0 +1,2 @@
|
||||
fastapi
|
||||
uvicorn
|
||||
Reference in New Issue
Block a user