Merge branch 'test' into dev
This commit is contained in:
commit
cd94460168
|
@ -1,5 +0,0 @@
|
|||
FROM vn-loopback:latest
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
CMD ["pm2-docker", "./server/server.js"]
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
// TODO: We are using latest tag until image rotation it's implemented
|
||||
env.COMPOSER_HTTP_TIMEOUT = 300;
|
||||
|
||||
switch (env.BRANCH_NAME) {
|
||||
|
@ -34,6 +33,6 @@ node {
|
|||
stage ('Generating new dockers') {
|
||||
sh "docker build -t vn-loopback:latest ./services/loopback/"
|
||||
sh "docker-compose up -d --build"
|
||||
sh "docker image prune --all"
|
||||
sh "docker image prune -f"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
version: '2'
|
||||
version: '3.5'
|
||||
services:
|
||||
nginx:
|
||||
container_name: "${BRANCH_NAME}-nginx"
|
||||
image: "nginx:${BUILD_NUMBER}"
|
||||
privileged: true
|
||||
build:
|
||||
context: ./services/nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
mem_limit: 200m
|
||||
- 80:80
|
||||
- 443:443
|
||||
links: []
|
||||
|
|
34
gulpfile.js
34
gulpfile.js
|
@ -163,35 +163,43 @@ gulp.task('docker-compose', async () => {
|
|||
|
||||
for (let service of services) {
|
||||
let dockerFile = `Dockerfile`;
|
||||
let containerName = `${namePrefix}${service.name}`;
|
||||
|
||||
let localDockerFile = `${__dirname}/services/${service.name}/Dockerfile`;
|
||||
|
||||
if (await fs.exists(localDockerFile))
|
||||
dockerFile = localDockerFile;
|
||||
|
||||
composeYml.services[service.name] = {
|
||||
container_name: containerName,
|
||||
image: `${service.name}:${imageTag}`,
|
||||
volumes: ['/config:/config'],
|
||||
build: {
|
||||
context: `./services`,
|
||||
dockerfile: dockerFile
|
||||
},
|
||||
ports: [`${service.port}:${defaultPort}`],
|
||||
environment: [
|
||||
'NODE_ENV=${NODE_ENV}',
|
||||
'salixHost=${salixHost}',
|
||||
'salixPort=${salixPort}',
|
||||
'salixUser=${salixUser}',
|
||||
'salixPassword=${salixPassword}'
|
||||
]
|
||||
environment: {
|
||||
NODE_ENV: '${NODE_ENV}',
|
||||
salixHost: '${salixHost}',
|
||||
salixPort: '${salixPort}',
|
||||
salixUser: '${salixUser}',
|
||||
salixPassword: '${salixPassword}'
|
||||
}
|
||||
};
|
||||
|
||||
composeYml.services.nginx.links.push(
|
||||
`${service.name}:${containerName}`
|
||||
`${service.name}:${namePrefix}${service.name}`
|
||||
);
|
||||
}
|
||||
|
||||
for (let serviceName in composeYml.services) {
|
||||
let service = composeYml.services[serviceName];
|
||||
Object.assign(service, {
|
||||
container_name: `${namePrefix}${serviceName}`,
|
||||
image: `${serviceName}:${imageTag}`,
|
||||
volumes: ['/config:/config']
|
||||
});
|
||||
service.build.labels = {
|
||||
'salix.tag': imageTag
|
||||
};
|
||||
}
|
||||
|
||||
let ymlString = yaml.safeDump(composeYml);
|
||||
await fs.writeFile('./docker-compose.yml', ymlString);
|
||||
});
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
datasources.test.json
|
||||
datasources.development.json
|
||||
datasources.*.json
|
||||
db.json
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"generator-loopback": {}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
FROM node:8.9.4
|
||||
FROM node:8-slim
|
||||
|
||||
COPY . /loopback
|
||||
RUN npm -g install pm2
|
||||
|
|
|
@ -13,9 +13,18 @@ http {
|
|||
include /etc/nginx/mime.types;
|
||||
|
||||
server {
|
||||
listen {{port}};
|
||||
server_name {{host}};
|
||||
autoindex off;
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
ssl_certificate /config/nginx/cert.pem;
|
||||
ssl_certificate_key /config/nginx/key.pem;
|
||||
server_name {{host}};
|
||||
autoindex off;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
|
|
Loading…
Reference in New Issue