From 96c692f8a22e38715eba740532259c01b5428a0b Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Mon, 25 Feb 2019 18:14:38 +0000 Subject: [PATCH] environment variables --- app/nuxt.config.js | 18 +++++++++++++----- docker-compose.yml | 5 +++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/nuxt.config.js b/app/nuxt.config.js index 335a531..937a195 100644 --- a/app/nuxt.config.js +++ b/app/nuxt.config.js @@ -3,10 +3,18 @@ const pkg = require('./package') module.exports = { mode: 'universal', - server: { - port: 3003, - host: '0.0.0.0' + env: { + urlInternal: process.env.URL_INTERNAL, + urlExternal: process.env.URL_EXTERNAL, + portApp: process.env.PORT_APP, + portServer: process.env.PORT_SERVER, }, + + server: { + port: process.env.portApp, + host: process.env.urlInternal, + }, + serverMiddleware: [ '~/api/contact', ], @@ -98,12 +106,12 @@ module.exports = { axios: { // See https://github.com/nuxt-community/axios-module#options proxy: true, - baseURL: 'http://192.168.0.101:3003', + baseURL: 'http://' + process.env.urlExternal + ':' + process.env.portApp, debug: false, }, proxy: { - '/api/v1/': 'http://192.168.0.101:3004' + '/api/v1/': 'http://' + process.env.urlExternal + ':' + process.env.portServer }, /* diff --git a/docker-compose.yml b/docker-compose.yml index eba029f..ee2e345 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,11 @@ services: restart: always ports: - ${URL_INTERNAL}:3003:3003 + environment: + - URL_INTERNAL: ${URL_INTERNAL} + - URL_EXTERNAL: ${URL_EXTERNAL} + - PORT_APP: ${PORT_APP} + - PORT_SERVER: ${PORT_SERVER} command: "npm run dev"