Skip to content

Commit

Permalink
Fix nginx config issue (#31)
Browse files Browse the repository at this point in the history
* Use root user in docker and fix nginx config

* Use non root user
  • Loading branch information
kumaranvpl authored Nov 11, 2024
1 parent e52bc88 commit bf45655
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 9 additions & 2 deletions {{cookiecutter.project_slug}}/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -e "."
RUN adduser --disabled-password --gecos '' appuser \
&& chown -R appuser /app \
&& chown -R appuser:appuser /etc/nginx/conf.d /var/log/nginx /var/lib/nginx \
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid \
# Allow binding to ports > 1024 without root
&& sed -i 's/listen 80/listen 9999/g' /etc/nginx/sites-available/default \
&& sed -i 's/listen \[::\]:80/listen \[::\]:9999/g' /etc/nginx/sites-available/default \
# Create required directories with correct permissions
&& mkdir -p /var/cache/nginx /var/run \
&& chown -R appuser:appuser /var/cache/nginx /var/run

USER appuser

EXPOSE 8000 8008 8888
# ToDo: Fix exposing ports
# EXPOSE 8000 8008 8888

CMD ["/app/run_fastagency.sh"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ server {
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;
proxy_buffering off;

Expand Down

0 comments on commit bf45655

Please sign in to comment.