Initial commit
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["sh", "-c", "\
|
||||
echo 'Waiting for database...' && \
|
||||
while ! python -c \"import psycopg2; psycopg2.connect('$DATABASE_URL')\" 2>/dev/null; do \
|
||||
sleep 1; \
|
||||
done && \
|
||||
echo 'Database ready!' && \
|
||||
alembic upgrade head && \
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 \
|
||||
"]
|
||||
Reference in New Issue
Block a user