So here's my problem, I have to dockerize my vue app to use it in a kubernetes/rancher environment.
I'd like to set in my rancher some env variable like the API base url for example, but I don't know how to do that.
Here's my dockerFile:
FROM nginx:stable-alpine
# define 'app'
WORKDIR /app
COPY dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
.gitlab-ci.yml
image: node:lts-alpine
stages:
- install
- tests
- build
- deploy-docker
- rerun-docker
cache:
paths:
- node_modules/
install:
stage: install
script: npm install
tags: [ docker ]
test:
stage: tests
script: npm run test:unit
tags: [ docker ]
build:
stage: build
script: npm run build
artifacts:
paths:
- dist
tags: [ docker ]
build_image:
stage: deploy-docker
image: //myurl//
script:
- docker build -t //myurl// .
- docker push //myurl//
only:
- develop
- feat/CI-front
tags: [ docker ]
rerun:
stage: rerun-docker
image: //adress///kubectl:latest
script:
- kubectl scale deployment //myproject// --replicas=0 -n //name//
- kubectl scale deployment //myproject// --replicas=1 -n //name//
only:
- develop
- feat/CI-front
tags: [ docker ]
And my .env if that's necessary
VUE_APP_API_BASE_URL = hello
Thank a lot