-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 containerization via docker and docker compose
- Loading branch information
Showing
7 changed files
with
735 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Ignore compiled python files | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
__pycache__ | ||
|
||
# Ignore environment related files | ||
# .env | ||
.venv | ||
*.log | ||
env/ | ||
|
||
# Ignore all git files | ||
.git/ | ||
.gitignore | ||
|
||
# Ignore OS generated files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
db.sqlite3 | ||
|
||
poetry.lock |
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,22 @@ | ||
FROM python:3.11-slim-buster | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libpq-dev \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
RUN pip install poetry | ||
COPY pyproject.toml /app | ||
|
||
COPY . /app | ||
RUN poetry install | ||
|
||
CMD ["./start_app.sh"] |
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,60 @@ | ||
version: '3.8' | ||
|
||
services: | ||
ifsguid_nginx: | ||
build: ./nginx | ||
image: nginx:alpine | ||
restart: unless-stopped | ||
container_name: ifsguid_nginx | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- "./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf:ro" | ||
- "./nginx/static:/static:ro" | ||
depends_on: | ||
- ifsguid_app | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
|
||
ifsguid_db: | ||
image: postgres:15-alpine | ||
restart: unless-stopped | ||
expose: | ||
- "5432" | ||
ports: | ||
- "5432:5432" | ||
container_name: ifsguid_db | ||
volumes: | ||
- ifsguid-postgres-data:/var/lib/postgresql/data | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
env_file: | ||
- .env | ||
|
||
ifsguid_app: | ||
build: . | ||
image: ifsguid:1.0.0 | ||
container_name: ifsguid_app | ||
restart: unless-stopped | ||
volumes: | ||
- "/etc/timezone:/etc/timezone:ro" | ||
- "/etc/localtime:/etc/localtime:ro" | ||
- "./nginx:/opt/nginx:rw" | ||
env_file: | ||
- ./.docker.env | ||
expose: | ||
- "8000" | ||
depends_on: | ||
- ifsguid_db | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
|
||
volumes: | ||
ifsguid-postgres-data: | ||
driver: local |
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,4 @@ | ||
FROM nginx:1.19.0-alpine | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY nginx.conf /etc/nginx/conf.d |
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,37 @@ | ||
upstream ifsguid { | ||
server ifsguid_app:8000; | ||
} | ||
|
||
limit_req_zone $binary_remote_addr zone=one:10m rate=50r/s; | ||
|
||
server { | ||
client_max_body_size 20m; | ||
|
||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://ifsguid; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
proxy_intercept_errors on; | ||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; | ||
error_page 404 /custom_404.html; | ||
error_page 502 503 504 /custom_404.html; | ||
} | ||
|
||
location /static/ { | ||
alias /static/; | ||
} | ||
|
||
error_page 404 /custom_404.html; | ||
error_page 502 /custom_502.html; | ||
location = /custom_404.html { | ||
root /static/error_pages; | ||
internal; | ||
} | ||
location = /custom_502.html { | ||
root /static/error_pages; | ||
internal; | ||
} | ||
} |
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,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" > | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>404 Not Found Page</title> | ||
<link rel="stylesheet" href="/static/error_pages/style.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<a href="/" target="_blank"> | ||
<header class="top-header"> | ||
</header> | ||
|
||
<!--dust particel--> | ||
<div> | ||
<div class="starsec"></div> | ||
<div class="starthird"></div> | ||
<div class="starfourth"></div> | ||
<div class="starfifth"></div> | ||
</div> | ||
<!--Dust particle end---> | ||
|
||
|
||
<div class="lamp__wrap"> | ||
<div class="lamp"> | ||
<div class="cable"></div> | ||
<div class="cover"></div> | ||
<div class="in-cover"> | ||
<div class="bulb"></div> | ||
</div> | ||
<div class="light"></div> | ||
</div> | ||
</div> | ||
<!-- END Lamp --> | ||
<section class="error"> | ||
<!-- Content --> | ||
<div class="error__content"> | ||
<div class="error__message message"> | ||
<h1 class="message__title">Page Not Found</h1> | ||
<p class="message__text">We're sorry, the page you were looking for isn't found here. The link you followed may either be broken or no longer exists. Please try again, or take a look at our.</p> | ||
</div> | ||
<div class="error__nav e-nav"> | ||
<a href="/" target="_blanck" class="e-nav__link"></a> | ||
</div> | ||
</div> | ||
<!-- END Content --> | ||
|
||
</section> | ||
|
||
</a> | ||
|
||
</body> | ||
</html> | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.