Skip to content

Commit 8fb2fe9

Browse files
feat: implement docker setup
1 parent e56127b commit 8fb2fe9

File tree

6 files changed

+23
-345
lines changed

6 files changed

+23
-345
lines changed

backend/.env.docker

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DOMAIN=${DOMAIN}
2+
FRONTEND_HOST=frontend:3000
3+
ENVIRONMENT=dev
4+
BACKEND_CORS_ORIGINS=*
5+
FIRST_SUPERUSER=admin
6+
POSTGRES_SERVER=db
7+
POSTGRES_PORT=5432
8+
POSTGRES_DB=treadeddb
9+
POSTGRES_USER=postgres

backend/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
FROM python:3.10
1+
FROM python:3.12-slim
22

3+
# ensures that Python's output is sent directly to the console or log stream without buffering.
4+
# This makes logs appear in real-time, which is essential for debugging and monitoring applications
5+
# running in Docker containers.
36
ENV PYTHONUNBUFFERED=1
47

58
WORKDIR /app/
@@ -40,4 +43,4 @@ COPY ./app /app/app
4043
RUN --mount=type=cache,target=/root/.cache/uv \
4144
uv sync
4245

43-
CMD ["fastapi", "run", "--workers", "4", "app/main.py"]
46+
ENTRYPOINT scripts/entrypoint.sh

backend/scripts/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bash scripts/prestart.sh
2+
3+
fastapi run --workers 4 app/main.py

docker-compose.override.yml

Lines changed: 0 additions & 133 deletions
This file was deleted.

docker-compose.traefik.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)