Skip to content
Snippets Groups Projects
Commit 9f9f8aa1 authored by Wilson JALLET's avatar Wilson JALLET :money_with_wings:
Browse files

inject password inside Dockerfile, inject in Docker thru GitLab CI

parent 13987ced
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ docker:build: ...@@ -51,7 +51,7 @@ docker:build:
- echo $LDAP_CONN_CONFIG > ldap_connexion_config.json - echo $LDAP_CONN_CONFIG > ldap_connexion_config.json
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- echo "Building Dockerfile..." - echo "Building Dockerfile..."
- docker build --pull -t ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} -t ${CI_APPLICATION_REPOSITORY}:latest --build-arg TARGET_ENV=staging . - docker build --pull -t ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} -t ${CI_APPLICATION_REPOSITORY}:latest --build-arg TARGET_ENV=staging --build-arg DB_PASSWD=${DB_PASSWD} .
- echo "Pushing to GitLab Container registry $CI_APPLICATION_REPOSITORY with tags '${CI_APPLICATION_TAG}' and 'latest'" - echo "Pushing to GitLab Container registry $CI_APPLICATION_REPOSITORY with tags '${CI_APPLICATION_TAG}' and 'latest'"
- docker push ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} - docker push ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
- docker push ${CI_APPLICATION_REPOSITORY}:latest - docker push ${CI_APPLICATION_REPOSITORY}:latest
......
...@@ -11,9 +11,9 @@ COPY package*.json ./ ...@@ -11,9 +11,9 @@ COPY package*.json ./
RUN npm install --only=production && npm i -g knex RUN npm install --only=production && npm i -g knex
ARG TARGET_ENV ARG TARGET_ENV
ARG LDAP_URI=ldap://frankiz.eleves.polytechnique.fr:389
ENV HOST=0.0.0.0 ENV HOST=0.0.0.0
ENV NODE_ENV=production ENV NODE_ENV=production
ENV LDAP_URI=ldap://frankiz.eleves.polytechnique.fr:389
COPY . . COPY . .
......
...@@ -34,9 +34,9 @@ module.exports = { ...@@ -34,9 +34,9 @@ module.exports = {
client: 'pg', client: 'pg',
connection: { connection: {
host: process.env.DB_HOST || '129.201.104.10', host: process.env.DB_HOST || '129.201.104.10',
user: 'will', user: process.env.DB_USER || 'sigma',
password: process.env.DB_PASSWD || 'password', password: process.env.DB_PASSWD || 'password',
database: 'sigma_dev', database: 'sigma_staging',
charset: 'utf8' charset: 'utf8'
}, },
...knexConfig ...knexConfig
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment