Skip to content

Commit e177ad3

Browse files
committed
Working proxy.
1 parent abcb8f7 commit e177ad3

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM nginx:1.15-alpine
2+
3+
COPY default.conf.tmpl /etc/nginx/default.conf.tmpl
4+
ADD https://raw.githubusercontent.com/nginx/nginx/master/conf/uwsgi_params /etc/nginx/uwsgi_params
5+
6+
ENV LISTEN_PORT=8000
7+
ENV APP_HOST=app
8+
ENV APP_PORT=8000
9+
10+
RUN mkdir -p /vol/static
11+
RUN adduser -D user
12+
RUN chmod 755 /vol/static
13+
RUN chown -R user:user /vol/static
14+
15+
COPY ./entrypoint.sh /entrypoint.sh
16+
RUN chmod +x /entrypoint.sh
17+
18+
CMD ["/entrypoint.sh"]

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# nginx-uwsgi-proxy
2-
NGINX container to use as a proxy for an uWSGI app
1+
# NGINX Django uWSGI Proxy
2+
3+
NGINX container designed to forward requests to a Django app running on uWSGI.

default.conf.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
server {
2+
listen ${LISTEN_PORT};
3+
4+
location /static {
5+
alias /vol/static;
6+
}
7+
8+
location / {
9+
uwsgi_pass ${APP_HOST}:${APP_PORT};
10+
include /etc/nginx/uwsgi_params;
11+
}
12+
}

entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
envsubst < /etc/nginx/default.conf.tmpl > /etc/nginx/conf.d/default.conf
3+
nginx -g 'daemon off;'

0 commit comments

Comments
 (0)