environment variables

This commit is contained in:
ManjaroOne666 2019-02-25 18:14:38 +00:00
parent fad9a88f42
commit 96c692f8a2
2 changed files with 18 additions and 5 deletions

View File

@ -3,10 +3,18 @@ const pkg = require('./package')
module.exports = { module.exports = {
mode: 'universal', mode: 'universal',
server: { env: {
port: 3003, urlInternal: process.env.URL_INTERNAL,
host: '0.0.0.0' 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: [ serverMiddleware: [
'~/api/contact', '~/api/contact',
], ],
@ -98,12 +106,12 @@ module.exports = {
axios: { axios: {
// See https://github.com/nuxt-community/axios-module#options // See https://github.com/nuxt-community/axios-module#options
proxy: true, proxy: true,
baseURL: 'http://192.168.0.101:3003', baseURL: 'http://' + process.env.urlExternal + ':' + process.env.portApp,
debug: false, debug: false,
}, },
proxy: { proxy: {
'/api/v1/': 'http://192.168.0.101:3004' '/api/v1/': 'http://' + process.env.urlExternal + ':' + process.env.portServer
}, },
/* /*

View File

@ -7,6 +7,11 @@ services:
restart: always restart: always
ports: ports:
- ${URL_INTERNAL}:3003:3003 - ${URL_INTERNAL}:3003:3003
environment:
- URL_INTERNAL: ${URL_INTERNAL}
- URL_EXTERNAL: ${URL_EXTERNAL}
- PORT_APP: ${PORT_APP}
- PORT_SERVER: ${PORT_SERVER}
command: command:
"npm run dev" "npm run dev"