mirror of https://github.com/fspc/workstand.git
Drew Larson
8 years ago
10 changed files with 106 additions and 22 deletions
@ -0,0 +1,13 @@ |
|||
FROM python:3.5 |
|||
RUN apt-get update |
|||
RUN apt-get install -y nodejs npm |
|||
RUN ln -s /usr/bin/nodejs /usr/bin/node |
|||
RUN mkdir /code |
|||
WORKDIR /code |
|||
RUN mkdir requirements |
|||
ADD bikeshop_project /code |
|||
COPY requirements /code/requirements |
|||
RUN pip install -r requirements/production.txt |
|||
RUN npm install |
|||
RUN npm run build-production |
|||
RUN DJANGO_SETTINGS_MODULE=bikeshop.settings.production python manage.py collectstatic --no-input |
@ -0,0 +1,34 @@ |
|||
version: "2" |
|||
services: |
|||
nginx: |
|||
build: |
|||
context: docker/nginx |
|||
ports: |
|||
- "80:80" |
|||
links: |
|||
- workstand |
|||
volumes_from: |
|||
- workstand:ro |
|||
workstand: |
|||
build: |
|||
context: . |
|||
dockerfile: Dockerfile-prod |
|||
image: workstand:production |
|||
env_file: |
|||
- workstand.env |
|||
command: gunicorn --log-file=- -b 0.0.0.0:8000 bikeshop.wsgi:application |
|||
environment: |
|||
- DJANGO_SETTINGS_MODULE=bikeshop.settings.production |
|||
volumes: |
|||
- static:/code/static |
|||
depends_on: |
|||
- redis |
|||
- db |
|||
redis: |
|||
restart: always |
|||
db: |
|||
restart: always |
|||
|
|||
volumes: |
|||
static: |
|||
external: false |
@ -0,0 +1,2 @@ |
|||
FROM nginx:alpine |
|||
COPY conf/* /etc/nginx/conf.d/ |
@ -0,0 +1,46 @@ |
|||
# server { |
|||
# listen 80; |
|||
# server_name www.shop.bcbc.bike; |
|||
# # $scheme will get the http protocol |
|||
# # and 301 is best practice for tablet, phone, desktop and seo |
|||
# return 301 https://shop.bcbc.bike$request_uri; |
|||
#} |
|||
#server { |
|||
# listen 80; |
|||
# server_name shop.bcbc.bike; |
|||
# # $scheme will get the http protocol |
|||
# # and 301 is best practice for tablet, phone, desktop and seo |
|||
# return 301 https://shop.bcbc.bike$request_uri; |
|||
#} |
|||
server { |
|||
# listen 443 ssl; |
|||
listen 80; |
|||
server_name shop.bcbc.bike; |
|||
|
|||
# ssl_certificate /etc/letsencrypt/live/{{ app_domain_name }}/fullchain.pem; |
|||
# ssl_certificate_key /etc/letsencrypt/live/{{ app_domain_name }}/privkey.pem; |
|||
|
|||
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
|||
# ssl_prefer_server_ciphers on; |
|||
# ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; |
|||
|
|||
location = /favicon.ico { access_log off; log_not_found off; } |
|||
keepalive_timeout 5; |
|||
root /code; |
|||
|
|||
location / { |
|||
# checks for static file, if not found proxy to app |
|||
try_files $uri @proxy_to_app; |
|||
} |
|||
|
|||
location @proxy_to_app { |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
# enable this if and only if you use HTTPS |
|||
# proxy_set_header X-Forwarded-Proto https; |
|||
proxy_set_header Host $http_host; |
|||
# we don't want nginx trying to do something clever with |
|||
# redirects, we set the Host: header above already. |
|||
proxy_redirect off; |
|||
proxy_pass http://workstand:8000; |
|||
} |
|||
} |
@ -1,5 +1,3 @@ |
|||
-r base.txt |
|||
-r testing.txt |
|||
django-debug-toolbar |
|||
PyYAML |
|||
gunicorn==19.4.5 |
@ -1 +1,2 @@ |
|||
-r base.txt |
|||
gunicorn==19.4.5 |
|||
|
@ -0,0 +1 @@ |
|||
DJANGO_SECRET_KEY=jfdklsafja438fj84pfh843afhapwfhsfuh |
Loading…
Reference in new issue