- Add .env or .env.js file in root directory
# .env
TEXT=local
# .env.js
module.exports = {
TEXT: 'local'
}
- Install dependencies
pnpm install
- Run dev script
pnpm run dev
- Install dependencies
pnpm install
- Run build script
pnpm run build
-
Check that all ok and your result in apps/*/lib directory
-
Eject node_modules for every app from apps/*
cd apps/api/lib
pnpm -F "." deploy .release
-
Check that all ok and your result in
apps/*/.release
directory -
Build docker image for every app in
apps/*
directory
cd apps/api
docker build -t kit-api .
- Gitlab CI (CI/CD)
- Docker Swarm (docker orchestrator)
- Nexus (docker registry)
- Traefik (loadbalancer)
- Check
deploy/gitlab-ci.yml
file
- Change
DOCKER_SERVICE
prefix andVIRTUAL_HOST
for your. - Add more stages/branches if you need.
- Check
deploy/docker-stack.yml
file
- Change
loadbalancer.server.port
for port of your app. - Change
deploy.replicas
if you need. - Change
deploy.placement.constraints
-node.labels
for your node labels. - Add more paths in
traefik.http.routers.*.rule
if you need.
- Change custom CI configuration path
For your project to deploy/.gitlab-ci.yml
or place .gitlab-ci.yml
to root directory
- Check or fill CI Varibles for Docker Registry
DOCKER_REGISTRY
-registry.buzz.guru
DOCKER_REGISTRY_USER
- username of nexus registryDOCKER_REGISTRY_PASS
- password of nexus registry
- Check or add .env and .env.js files
files in CI Variables for every stage
{{STAGENAME}}_env_file
for .env file{{STAGENAME}}_env_js
for .env.js file
You can change variable names in deploy/docker-stack.yml
- Check you branch protected option
- Push
master
branch forprod
stagedevelop
branch fordev
stage
kubectl apply -f ./deploy/k8s-deploy.yaml
The easiest way to apply the configuration to kubectl is to put it in ~/.kube/config
and check it with kubectl cluster-info
, it should output the cluster ip or just no errors
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
kubectl proxy
Open in browser:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
kubectl apply -f ./deploy/traefik-deployment.yaml
Use kubectl get services
until services starting with traefik
get the EXTERNAL-IP