-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update README for Docker setup, add Dockerfile, docker-compose,…
… and Nginx configuration
- Loading branch information
1 parent
a913413
commit 5badbdf
Showing
7 changed files
with
112 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.12-slim | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
gcc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install uv | ||
|
||
COPY . . | ||
RUN uv sync | ||
|
||
ENV FLASK_APP=app.py | ||
ENV FLASK_ENV=production | ||
|
||
CMD uv run flask db upgrade && \ | ||
uv run gunicorn --bind 0.0.0.0:5000 'app:create_app()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
services: | ||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
restart: always | ||
env_file: | ||
- ./backend/.env | ||
depends_on: | ||
- db | ||
networks: | ||
- internal | ||
|
||
db: | ||
image: postgres:latest | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
env_file: | ||
- ./backend/.env | ||
networks: | ||
- internal | ||
|
||
nginx: | ||
image: nginx:latest | ||
restart: always | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- backend | ||
networks: | ||
- internal | ||
|
||
volumes: | ||
postgres_data: | ||
|
||
networks: | ||
internal: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
listen 80; | ||
server_name _; | ||
|
||
location / { | ||
proxy_pass http://backend:5000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} |