Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
Chore: Add nginx container for AWS deployment
Browse files Browse the repository at this point in the history
Fix gunicorn CMD for triage-portal container

Signed-off-by: Anton Baranov <abaranov@linuxfoundation.org>
  • Loading branch information
spacedog committed Jul 31, 2023
1 parent 25c028c commit 5f3ed45
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
37 changes: 37 additions & 0 deletions docker-compose.aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.9'

services:
redis:
image: redis:latest
restart: unless-stopped
# network_mode: service:db
volumes:
- redis-data:/data
tiriage-nginx:
image: nginx
build:
context: src/nginx
ports:
- "8001:80"
depends_on:
- triage-portal
volumes:
- triage-portal-static:/opt/omega/static
environment:
- TRIAGE_PORTAL_HOST=triage-portal
triage-portal:
image: omega-triage-portal
build:
context: src
container_name: omega-triage-portal
depends_on:
redis:
condition: service_started
env_file:
- ./src/.env-template
volumes:
- triage-portal-static:/opt/omega/static

volumes:
redis-data:
triage-portal-static:
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ COPY . /app/
EXPOSE 8001

CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]
CMD ["gunicorn" , "-b", "0.0.0.0:8001", "app:app"]
CMD ["gunicorn" , "-b", "0.0.0.0:8001", "core.wsgi:application"]
7 changes: 7 additions & 0 deletions src/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:1.24.0-alpine

ENV TRIAGE_PORTAL_HOST=localhost
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
COPY templates/ /etc/nginx/templates/
EXPOSE 80
16 changes: 16 additions & 0 deletions src/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {

listen 80;

location /static/ {
alias /opt/omega/static/;
}

location / {
proxy_pass http://triage_portal;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

}
3 changes: 3 additions & 0 deletions src/nginx/templates/upstreams.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upstream triage_portal {
server ${TRIAGE_PORTAL_HOST}:8001;
}

0 comments on commit 5f3ed45

Please sign in to comment.