Skip to content

Commit

Permalink
Merge remote-tracking branch 'UPSTREAM/develop' into new_gunicorn
Browse files Browse the repository at this point in the history
# Conflicts:
#	requirements.txt
  • Loading branch information
tawoe committed Oct 23, 2024
2 parents a03df1b + e106ef8 commit 878e807
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
18 changes: 7 additions & 11 deletions .github/apimanager.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#http {
# server {
# listen 8080 default_server;
# listen [::]:8080 default_server;

server_name apimanager;
server {
listen 8080;
server_name apimanager;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -15,13 +12,12 @@
}

location /en/static {
alias /opt/app-root/src;
alias /usr/share/nginx/html;
}
location /es/static {
alias /opt/app-root/src;
alias /usr/share/nginx/html;
}
location /static {
alias /opt/app-root/src;
alias /usr/share/nginx/html;
}
# }
#}
}
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM python:3.10
USER root
COPY . /app
COPY .github/local_settings_container.py /app/apimanager/apimanager/local_settings.py
COPY .github/gunicorn.conf.py /app/gunicorn.conf.py
RUN pip install -r /app/requirements.txt
WORKDIR /app
RUN ./apimanager/manage.py migrate
RUN chgrp -R 0 /app && chmod -R g+rwX /app
USER 501
WORKDIR /app/apimanager
EXPOSE 8000
CMD ["gunicorn", "--bind", ":8000", "--config", "../gunicorn.conf.py", "apimanager.wsgi"]
16 changes: 3 additions & 13 deletions Dockerfile_nginx
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
FROM python:3.10 AS builder
USER 0
COPY . /app
RUN cp /app/.github/local_settings_container.py /app/apimanager/apimanager/local_settings.py
RUN pip install -r /app/requirements.txt
RUN chown 501 /
RUN chown -R 501 /app
RUN chgrp -R 0 /app && chmod -R g+rwX /app
USER 1001
WORKDIR /app
RUN python ./apimanager/manage.py collectstatic --noinput

FROM nginx:mainline-alpine
USER 0
#RUN dnf update -y
ADD .github/apimanager.conf "${NGINX_DEFAULT_CONF_PATH}"
COPY --from=builder /app/apimanager/static /opt/app-root/src
RUN chgrp -R 0 /opt/app-root/src/ && chmod -R g+rwX /opt/app-root/src/
USER 1001
FROM nginxinc/nginx-unprivileged:stable
COPY .github/apimanager.conf /etc/nginx/conf.d/
COPY --from=builder /app/apimanager/static /usr/share/nginx/html
CMD nginx -g "daemon off;"


2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psycopg2-binary
psycopg2
#Django==1.11.7
Django==2.2.28
oauthlib==3.2.2
Expand Down

0 comments on commit 878e807

Please sign in to comment.