Skip to content

Commit 8a70161

Browse files
committed
Simplifying Nginx structure, adding IPv6.
1 parent eb45941 commit 8a70161

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Start the server (and associated containers) using:
2727

2828
```bash
2929
screen
30-
sudo docker compose up
30+
sudo docker compose up web
3131
```
3232

3333
### Initialising
@@ -53,7 +53,7 @@ To update the tool, take the containers down, rebuild, and restart using:
5353
screen -r
5454
sudo docker compose down
5555
sudo docker compose build --no-cache
56-
sudo docker compose up
56+
sudo docker compose up web
5757
```
5858

5959
# Extra

docker-compose.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
services:
2+
# This is only required if you're running it stand-alone; on the deployment it shares a VM,
3+
# so the nginx file has to be used by the actual VM-level Nginx.
24
nginx:
35
container_name: physics-workload-nginx
46
image: nginx:latest
57
ports:
6-
- "8000:80"
7-
- "8443:443"
8+
- "80:80"
9+
- "443:443"
810
volumes:
911
- type: bind
10-
source: "${PROJECT_PATH}/nginx/app.conf"
12+
source: "${PROJECT_PATH}/nginx/physics_workload.conf"
1113
target: "/etc/nginx/conf.d/default.conf"
1214
- type: bind
1315
source: "${PROJECT_PATH}/logs/"
@@ -31,8 +33,8 @@ services:
3133
build:
3234
dockerfile: Dockerfile
3335
context: .
34-
expose:
35-
- "8000"
36+
ports:
37+
- "8000:8000"
3638
env_file:
3739
- "./.env.default"
3840
- "./.env"

nginx/app.conf renamed to nginx/physics_workload.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ server {
1212
}
1313

1414
location / {
15-
proxy_pass http://physics_workload_django:8000;
15+
# proxy_pass http://web:8000; # For if you're serving it standalone through nginx on docker-compose.
16+
proxy_pass http://localhost:8000;
1617
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
1718
proxy_redirect off;
1819
proxy_buffering off;
@@ -23,6 +24,7 @@ server {
2324
}
2425

2526
listen 443 ssl;
27+
listen [::]:443 ssl;
2628

2729
ssl_certificate /etc/tls/certs/teaching.physics.soton.ac.uk.pem;
2830
ssl_certificate_key /etc/tls/private/teaching.physics.soton.ac.uk.key;
@@ -31,6 +33,8 @@ server {
3133
# Redirect non-HTTPS traffic to HTTPS
3234
server {
3335
listen 80;
36+
listen [::]:80;
37+
3438
server_name teaching.physics.soton.ac.uk;
3539
return 301 https://$host:$request_uri;
3640
}

0 commit comments

Comments
 (0)