From 1b47612c5e942ce104a4d509eb69913fe25e053e Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 25 Sep 2024 14:12:02 +0200 Subject: [PATCH] feat: refs #6695 try up db --- .dockerignore | 2 +- Jenkinsfile | 42 ++++++++++++++++++++--------------------- db/Dockerfile | 32 +++++++++++++++++++++++++++++++ docker-compose.test.yml | 22 +++++++++++++++++++++ 4 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 db/Dockerfile create mode 100644 docker-compose.test.yml diff --git a/.dockerignore b/.dockerignore index d1eb098d2..c61065e3d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ -node_modules print/node_modules +front e2e diff --git a/Jenkinsfile b/Jenkinsfile index 4716189a9..f2dd682a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,27 +186,27 @@ pipeline { } } } - stage('Push') { - when { - expression { RUN_BUILD } - } - environment { - CREDENTIALS = credentials('docker-registry') - } - steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" - } - sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' - sh 'docker-compose push' - script { - if (env.BRANCH_NAME == 'master') { - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker push $IMAGE:latest' - } - } - } + // stage('Push') { + // when { + // expression { RUN_BUILD } + // } + // environment { + // CREDENTIALS = credentials('docker-registry') + // } + // steps { + // script { + // def packageJson = readJSON file: 'package.json' + // env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + // } + // sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' + // sh 'docker-compose push' + // script { + // if (env.BRANCH_NAME == 'master') { + // sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + // sh 'docker push $IMAGE:latest' + // } + // } + // } } stage('Deploy') { when { diff --git a/db/Dockerfile b/db/Dockerfile new file mode 100644 index 000000000..79160940f --- /dev/null +++ b/db/Dockerfile @@ -0,0 +1,32 @@ +FROM node:20-bullseye AS base +# FROM back AS base + +ENV TZ Europe/Madrid +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libkrb5-dev libssl-dev + +RUN npm i -g pnpm + +WORKDIR /salix + +COPY db db +# COPY node_modules node_modules +COPY myt.config.yml . +# RUN ls + +RUN pnpm i @verdnatura/myt + + +FROM base AS db + +WORKDIR /salix +# RUN cat myt.config.yml +# RUN ls +# RUN cd db +# RUN ls +RUN usermod -aG docker $USER +# RUN npx myt run -d +CMD ["npx", "myt", "run", "-d"] diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 000000000..b9052cf3e --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,22 @@ +version: '3.7' +services: + front: + image: registry.verdnatura.es/salix-front:${VERSION:?} + build: + context: front + back: + image: registry.verdnatura.es/salix-back:${VERSION:?} + build: + context: . + dockerfile: back/Dockerfile + volumes: + - ./storage:/salix/storage + db: + image: db + build: + context: . + dockerfile: db/Dockerfile + target: db + volumes: + - /var/run/docker.sock:/var/run/docker.sock + user: root