Skip to content

Commit d0775b9

Browse files
committed
refactored dev hostnames for screenshot service, because localhost context is not flexible enough, now http://www:8000 instead of http://localhost:8080 as dev url
1 parent a3f9754 commit d0775b9

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

django/main/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
CORS_ORIGIN_WHITELIST = [
130130
"http://localhost:8080",
131131
"http://localhost:8081",
132+
"http://www:8000",
133+
"http://www.local:8000",
132134
]
133135
CORS_ALLOW_CREDENTIALS = True
134136
CACHES = {

docker-compose.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
environment:
2828
- TERM=xterm-256color
2929
- START_SCREENSHOTSERVICE=NO
30-
- PUBLIC_URL=http://localhost:8080
30+
- PUBLIC_URL=http://www:8000
3131
- VUE_APP_MAPBOX_ACCESSTOKEN=pk.eyJ1IjoiZ2VtZWluZGVzY2FuIiwiYSI6ImNrNXdrOXV2ZjEwdXcza28wcXNoYXE1ZGMifQ.P-nCvxNRK4AOs7YdRbHCLg
3232
- VUE_APP_MAPBOX_DEFAULT_STYLES=mapbox://styles/gemeindescan/ck6rp249516tg1iqkmt48o4pz
3333
working_dir: /opt/vue
@@ -36,7 +36,7 @@ services:
3636
- var-gemeindescan-webui:/var/services/
3737
- vscode-remote-vue:/root/.vscode-server
3838
ports:
39-
# - "9222:9222" # debug chrome
39+
- "9222:9222" # debug chrome
4040
- "8079:8079" # snapshost service
4141
- "10001:10001" # vscode
4242

@@ -55,14 +55,12 @@ services:
5555
- DJANGO_HTTPS=False
5656
- DJANGO_EMAIL_HOST=maildev
5757
- DJANGO_SECRET_KEY=adddxxccxx4rt0ioywg3yf5kjq64-t5
58-
- DJANGO_ALLOWED_HOSTS=local.gemeindescan.ch,localhost,django
58+
- DJANGO_ALLOWED_HOSTS=www,www.local,localhost,django
5959
working_dir: /opt/app
6060
volumes:
6161
- ./django:/opt/app
6262
- var-gemeindescan-webui:/var/services
6363
- vscode-remote-django:/root/.vscode-server
64-
links:
65-
- pdb
6664
ports:
6765
- "10002:10002" # vscode
6866
# entrypoint: tail
@@ -74,9 +72,6 @@ services:
7472
volumes:
7573
- ./etc/nginx:/etc/nginx/conf.d
7674
- var-gemeindescan-webui:/var/services
77-
links:
78-
- django
79-
- vue
8075
ports:
81-
- 8080:80
76+
- 8000:8000
8277
# command: tail -f /dev/null

etc/nginx/localhost.conf renamed to etc/nginx/www.local.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ upstream vue-dev {
77
}
88

99
server {
10-
listen 80;
11-
server_name localhost;
10+
listen 8000;
11+
server_name www www.local;
1212

13-
access_log /var/log/localhost.access.log;
14-
error_log /var/log/localhost.error.log error;
13+
access_log /var/log/local.www.access.log;
14+
error_log /var/log/local.www.error.log error;
1515

1616
client_max_body_size 10M;
1717

@@ -20,7 +20,7 @@ server {
2020
location = / {
2121
set $lang_sup "de,fr";
2222
set_by_lua_file $lang_accept /etc/nginx/conf.d/lang.lua $lang_sup;
23-
return $scheme://$host:8080/$lang_accept;
23+
return $scheme://$host:8000/$lang_accept;
2424
}
2525

2626

@@ -89,7 +89,7 @@ server {
8989

9090
# vue dev server mode hotreload
9191
location /sockjs-node {
92-
proxy_pass http://vue:8080;
92+
proxy_pass http://vue-dev;
9393
proxy_set_header Host $host;
9494
proxy_set_header X-Real-IP $remote_addr;
9595
proxy_set_header X-Forwarded-For $remote_addr;

vue/vue.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
module.exports = {
2+
devServer: {
3+
compress: true,
4+
inline: true,
5+
port: '8080',
6+
public: 'www',
7+
allowedHosts: [
8+
'www',
9+
'www.local',
10+
'localhost',
11+
'vue'
12+
]
13+
},
214
transpileDependencies: [
315
'vuetify'
416
],

0 commit comments

Comments
 (0)