From 5681c917ea2daac38e9dfe2b47fcf29a00511cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 6 Sep 2020 01:53:13 +0200 Subject: [PATCH] add development proxy (nginx instance) --- dev-proxy/Dockerfile | 4 ++++ dev-proxy/nginx.conf | 23 +++++++++++++++++++++++ docker-compose.yml | 6 +++++- ui/vue.config.js | 6 ++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 dev-proxy/Dockerfile create mode 100644 dev-proxy/nginx.conf create mode 100644 ui/vue.config.js diff --git a/dev-proxy/Dockerfile b/dev-proxy/Dockerfile new file mode 100644 index 0000000..9b47d13 --- /dev/null +++ b/dev-proxy/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:stable-alpine +LABEL maintainer="joern-michael.miehe@lenaisten.de" + +COPY nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/dev-proxy/nginx.conf b/dev-proxy/nginx.conf new file mode 100644 index 0000000..de19e86 --- /dev/null +++ b/dev-proxy/nginx.conf @@ -0,0 +1,23 @@ +upstream ui { + server ui:8080; +} + +# upstream api { +# server api:3000; +# } + +server { + listen 80 default_server; + server_name _; + + error_log /dev/stderr; + access_log /dev/stdout; + + location / { + proxy_pass http://ui; + } + + # location /api/ { + # proxy_pass http://api; + # } +} diff --git a/docker-compose.yml b/docker-compose.yml index aff0d7d..f6da609 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,5 +12,9 @@ services: - "${PWD}/ui:/srv/vue/bday2020" ports: - 8000:8000 - - 8080:8080 + dev-proxy: + build: dev-proxy + restart: 'no' + ports: + - 8080:80 diff --git a/ui/vue.config.js b/ui/vue.config.js new file mode 100644 index 0000000..90aaf65 --- /dev/null +++ b/ui/vue.config.js @@ -0,0 +1,6 @@ +// vue.config.js +module.exports = { + devServer: { + disableHostCheck: true + } +} \ No newline at end of file