Skip to content

Commit

Permalink
nginx como proxy por conta do https
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarkun committed Oct 2, 2023
1 parent 6a4cd63 commit d85b5d9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Instale as dependências necessárias para OpenBLAS e pip (se precisar)
RUN apt-get update && apt-get install -y \
libopenblas-dev \
libopenblas-dev ffmpeg \
&& rm -rf /var/lib/apt/lists/*

# Instale o pacote Python com os argumentos CMake
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Use uma imagem base do NGINX
FROM nginx:alpine

# Copie os arquivos de configuração e os certificados
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/certs/ /etc/nginx/certs/
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ services:
depends_on:
- weaviate
volumes:
- ./app:/app
- ./app:/app

nginx:
build:
context: .
dockerfile: Dockerfile.nginx
ports:
- 80:80
- 443:443
depends_on:
- flask-app
20 changes: 20 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
events {
worker_connections 1024;
}

http {
server {
listen 80;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;

location / {
proxy_pass http://flask-app:5000;
}
}
}

0 comments on commit d85b5d9

Please sign in to comment.