mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
commit
ce2eac0f45
@ -8,6 +8,8 @@ services:
|
||||
image: gradido/frontend:development
|
||||
build:
|
||||
target: development
|
||||
networks:
|
||||
- external-net
|
||||
environment:
|
||||
- NODE_ENV="development"
|
||||
# - DEBUG=true
|
||||
|
||||
@ -15,13 +15,13 @@ services:
|
||||
context: ./frontend
|
||||
target: production
|
||||
networks:
|
||||
- external-net
|
||||
- internal-net
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 3000:3000
|
||||
environment:
|
||||
# Envs used in Dockerfile
|
||||
# - DOCKER_WORKDIR="/app"
|
||||
# - PORT="8080"
|
||||
# - PORT=3000
|
||||
- BUILD_DATE
|
||||
- BUILD_VERSION
|
||||
- BUILD_COMMIT
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
LOGIN_API_URL=http://localhost/login_api/
|
||||
COMMUNITY_API_URL=http://localhost/api/
|
||||
VUE_PATH=/vue
|
||||
COMMUNITY_API_URL=http://localhost/api/
|
||||
@ -15,7 +15,7 @@ ENV BUILD_COMMIT="0000000"
|
||||
## SET NODE_ENV
|
||||
ENV NODE_ENV="production"
|
||||
## App relevant Envs
|
||||
ENV PORT="8080"
|
||||
ENV PORT="3000"
|
||||
|
||||
# Labels
|
||||
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||
@ -82,15 +82,14 @@ FROM base as production
|
||||
|
||||
# Copy "binary"-files from build image
|
||||
COPY --from=build ${DOCKER_WORKDIR}/dist ./dist
|
||||
#COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules
|
||||
#COPY --from=build ${DOCKER_WORKDIR}/nuxt.config.js ./nuxt.config.js
|
||||
# We also copy the node_modules express and serve-static for the run script
|
||||
COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules
|
||||
# Copy static files
|
||||
# TODO - this should be one Folder containign all stuff needed to be copied
|
||||
#COPY --from=build ${DOCKER_WORKDIR}/constants ./constants
|
||||
#COPY --from=build ${DOCKER_WORKDIR}/static ./static
|
||||
#COPY --from=build ${DOCKER_WORKDIR}/locales ./locales
|
||||
COPY --from=build ${DOCKER_WORKDIR}/public ./public
|
||||
# Copy package.json for script definitions (lock file should not be needed)
|
||||
COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json
|
||||
# Copy run scripts run/
|
||||
COPY --from=build ${DOCKER_WORKDIR}/run ./run
|
||||
|
||||
# Run command
|
||||
CMD /bin/sh -c "yarn run start"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"version": "0.9.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"start": "node run/server.js",
|
||||
"serve": "vue-cli-service serve --open",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "eslint --ext .js,.vue .",
|
||||
|
||||
14
frontend/run/server.js
Normal file
14
frontend/run/server.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Imports
|
||||
const express = require('express')
|
||||
const serveStatic = require('serve-static')
|
||||
|
||||
// Port
|
||||
const port = process.env.PORT || 3000
|
||||
|
||||
// Express Server
|
||||
const app = express()
|
||||
app.use(serveStatic(__dirname + '/../dist'))
|
||||
app.listen(port)
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`http://frontend:${port} server started.`)
|
||||
@ -1,7 +0,0 @@
|
||||
var express = require('express')
|
||||
var serveStatic = require('serve-static')
|
||||
var app = express()
|
||||
app.use(serveStatic(__dirname + '/dist'))
|
||||
var port = process.env.PORT || 5000
|
||||
app.listen(port)
|
||||
// console.log('http://localhost:5000 server started.');
|
||||
@ -6,6 +6,7 @@ Vue.use(VueRouter)
|
||||
|
||||
// configure router
|
||||
const router = new VueRouter({
|
||||
base: '/vue',
|
||||
routes, // short for routes: routes
|
||||
linkActiveClass: 'active',
|
||||
mode: 'history',
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<span class="alert-text" v-html="$t('form.scann_code')"></span>
|
||||
<b-col v-show="!scan" lg="12" class="text-right">
|
||||
<a @click="toggle" class="nav-link pointer">
|
||||
<img src="/img/icons/gradido/qr-scan-pure.png" height="50" />
|
||||
<img src="img/icons/gradido/qr-scan-pure.png" height="50" />
|
||||
</a>
|
||||
</b-col>
|
||||
|
||||
|
||||
@ -1,17 +1,11 @@
|
||||
const path = require('path')
|
||||
const dotenv = require('dotenv-webpack')
|
||||
|
||||
function resolveSrc(_path) {
|
||||
return path.join(__dirname, _path)
|
||||
}
|
||||
|
||||
let vue_path = process.env.VUE_PATH
|
||||
if (vue_path == undefined) {
|
||||
vue_path = '/vue'
|
||||
}
|
||||
|
||||
// vue.config.js
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: process.env.PORT || 3000,
|
||||
},
|
||||
pluginOptions: {
|
||||
i18n: {
|
||||
locale: 'de',
|
||||
@ -21,12 +15,12 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
lintOnSave: true,
|
||||
publicPath: vue_path + '/',
|
||||
publicPath: '/vue',
|
||||
configureWebpack: {
|
||||
// Set up all the aliases we use in our app.
|
||||
resolve: {
|
||||
alias: {
|
||||
assets: resolveSrc('src/assets'),
|
||||
assets: path.join(__dirname, 'src/assets'),
|
||||
},
|
||||
},
|
||||
plugins: [new dotenv()],
|
||||
@ -35,5 +29,5 @@ module.exports = {
|
||||
// Enable CSS source maps.
|
||||
sourceMap: process.env.NODE_ENV !== 'production',
|
||||
},
|
||||
outputDir: path.resolve(__dirname, './dist' + vue_path),
|
||||
outputDir: path.resolve(__dirname, './dist'),
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
server {
|
||||
|
||||
listen 80 ;
|
||||
@ -8,12 +6,10 @@ server {
|
||||
|
||||
#include /etc/nginx/common/protect.conf;
|
||||
#include /etc/nginx/common/protect_add_header.conf;
|
||||
#include /etc/nginx/common/ssl.conf;
|
||||
|
||||
#include /etc/nginx/common/ssl.conf;
|
||||
|
||||
root /var/www/cakephp/webroot;
|
||||
index index.php;
|
||||
|
||||
index index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass community-server:9000;
|
||||
@ -23,7 +19,6 @@ server {
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
include fastcgi_params;
|
||||
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
@ -31,65 +26,61 @@ server {
|
||||
}
|
||||
|
||||
location /account {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
rewrite /account/(.*) /$1 break;
|
||||
|
||||
#proxy_next_upstream error timeout invalid_header http_502 non_idempotent;
|
||||
proxy_pass http://login-server:1200;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
rewrite /account/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://login-server:1200;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /login_api {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
rewrite /login_api/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://login-server:1201;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
rewrite /login_api/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://login-server:1201;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location /vue {
|
||||
|
||||
location /vue/sockjs-node {
|
||||
rewrite /vue/(.*) /$1;
|
||||
}
|
||||
location ~* \.(png) {
|
||||
expires 1d;
|
||||
rewrite /vue/(.*) /$1;
|
||||
}
|
||||
|
||||
#try_files /vue/$uri /vue/$uri/ /index.html;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
#rewrite /vue/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://frontend:3000;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
proxy_pass http://frontend:8080;
|
||||
location /sockjs-node {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
proxy_pass http://frontend:3000;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# access_log /var/log/nginx/access.log main;
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user