-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update deployment configuration and infrastructure (#236)
- Loading branch information
1 parent
0c677db
commit 85215b7
Showing
11 changed files
with
529 additions
and
96,625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
FROM python:3.8 | ||
|
||
ARG HTTP_PROXY | ||
ARG HTTPS_PROXY | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV HTTP_PROXY=${HTTP_PROXY} | ||
ENV HTTPS_PROXY=${HTTPS_PROXY} | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
COPY requirements.txt /code/ | ||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY requirements.txt /app/ | ||
|
||
RUN if [ -n "$HTTPS_PROXY" ] ; then pip install -r requirements.txt --proxy ${HTTPS_PROXY}; else pip install -r requirements.txt ; fi | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /code/ | ||
COPY . /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
version: '3.9' | ||
|
||
services: | ||
web: | ||
image: harbor-registry.whoi.edu/photic/photic_web:1.0 | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
volumes: | ||
- ${ROI_PATH}:/rois | ||
- static-files:/app/static | ||
- ./local_settings.py:/app/photic/local_settings.py:ro | ||
networks: | ||
- photic | ||
restart: unless-stopped | ||
depends_on: | ||
- db | ||
|
||
db: | ||
image: postgres:${POSTGRES_TAG:-12-alpine} | ||
env_file: | ||
- .env | ||
volumes: | ||
- ${POSTGRES_DATA_PATH}:/var/lib/postgresql/data | ||
networks: | ||
- photic | ||
restart: unless-stopped | ||
|
||
nginx: | ||
image: nginx:alpine | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
- ${SSL_CERT}:/ssl/ssl.cer:ro | ||
- ${SSL_KEY}:/ssl/ssl.key:ro | ||
- static-files:/app/static:ro | ||
- ${ROI_PATH}:/rois | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
depends_on: | ||
- web | ||
networks: | ||
- photic | ||
restart: unless-stopped | ||
|
||
volumes: | ||
static-files: | ||
nginx-config: | ||
|
||
|
||
networks: | ||
photic: | ||
name: photic | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
upstream photic_server { | ||
server web:8000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location /static/ { | ||
root /app; | ||
} | ||
|
||
location /rois/ { | ||
root /; | ||
} | ||
|
||
location / { | ||
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
|
||
if (!-f $request_filename) { | ||
proxy_pass http://photic_server; | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
upstream photic_server { | ||
server web:8000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name elvira.whoi.edu; | ||
|
||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 default_server ssl; | ||
server_name elvira.whoi.edu; | ||
|
||
ssl_certificate /ssl/ssl.cer; | ||
ssl_certificate_key /ssl/ssl.key; | ||
|
||
location /static/ { | ||
root /app; | ||
} | ||
|
||
location /rois/ { | ||
root /; | ||
} | ||
|
||
location / { | ||
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
|
||
if (!-f $request_filename) { | ||
proxy_pass http://photic_server; | ||
break; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.