alterações gerais
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
# FROM docker.io/python:3.12.9-slim-bookworm AS python # Linha removida, já definida abaixo
|
||||
|
||||
# Python build stage - Mantenha apenas dependências de BUILD aqui
|
||||
FROM docker.io/python:3.12.9-slim-bookworm AS python-build-stage
|
||||
|
||||
ARG BUILD_ENVIRONMENT=local
|
||||
@ -44,9 +42,10 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-por \
|
||||
ghostscript \
|
||||
openjdk-17-jdk \
|
||||
# libtesseract-dev \
|
||||
# Utilitários do devcontainer e outros
|
||||
sudo git bash-completion vim ssh \
|
||||
sudo git bash-completion vim ssh curl \
|
||||
# Limpeza
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@ -4,7 +4,17 @@ set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
|
||||
# Aplica migrações antes de iniciar o servidor
|
||||
python manage.py migrate
|
||||
|
||||
exec python manage.py runserver_plus 0.0.0.0:8005
|
||||
# Coleta arquivos estáticos
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
python manage.py compress --force
|
||||
|
||||
# Inicia o servidor com Gunicorn
|
||||
exec gunicorn config.wsgi:application \
|
||||
--bind 0.0.0.0:8005 \
|
||||
--workers 4 \
|
||||
--timeout 120
|
||||
# python manage.py runserver_plus 0.0.0.0:8005
|
||||
|
||||
44
compose/local/nginx/nginx.conf
Normal file
44
compose/local/nginx/nginx.conf
Normal file
@ -0,0 +1,44 @@
|
||||
upstream django {
|
||||
server django:8005;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name 192.168.235.234 localhost;
|
||||
|
||||
client_max_body_size 10M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://django;
|
||||
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;
|
||||
proxy_redirect off;
|
||||
|
||||
# Timeouts
|
||||
proxy_connect_timeout 75s;
|
||||
proxy_read_timeout 300s;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
alias /app/staticfiles/;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
alias /app/media/;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
|
||||
# Bloqueia acesso a arquivos ocultos
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user