Created
October 15, 2018 20:44
-
-
Save bazzilio/b5da725536f7d3d643c7d1e60a06a842 to your computer and use it in GitHub Desktop.
Gitlab <-> Docker-compose issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.build: &build | |
stage: build | |
script: | |
- docker-compose -f ./docker-compose.yml build | |
.deploy: &deploy | |
stage: deploy | |
script: | |
- docker-compose -f ./docker-compose.yml up -d | |
.develop_env: &develop_env | |
variables: | |
API_URL: https://dev.example.eu/v1/ | |
TICKETS_HOST: dev.tickets.example.eu | |
NODE_TAG: dev | |
NODE_NAME: expo-tickets | |
.staging_env: &staging_env | |
variables: | |
API_URL: https://example.eu/v1/ | |
TICKETS_HOST: tickets.example.eu | |
NODE_TAG: staging | |
NODE_NAME: expo-tickets | |
environment: | |
name: staging | |
only: | |
- staging | |
dev_build: | |
<<: *develop_env | |
<<: *build | |
tags: | |
- expo-dev | |
dev_deploy: | |
<<: *develop_env | |
<<: *deploy | |
tags: | |
- expo-dev | |
staging_build: | |
<<: *staging_env | |
<<: *build | |
tags: | |
- expo-dev | |
staging_deploy: | |
<<: *staging_env | |
<<: *deploy | |
tags: | |
- expo-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker-compose -f ./docker-compose.yml down | |
Stopping expo-tickets-dev ... | |
Stopping expo-tickets-dev ... done | |
Removing expo-tickets-dev ... | |
Removing expo-tickets-dev ... done | |
$ docker-compose -f ./docker-compose.yml up -d | |
Creating expo-tickets-staging ... | |
Creating expo-tickets-staging ... done | |
Job succeeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
nginx: | |
container_name: $NODE_NAME-$NODE_TAG | |
network_mode: "bridge" | |
restart: "on-failure" | |
image: $NODE_NAME:$NODE_TAG | |
build: | |
context: . | |
args: | |
- NODE_ENV="production" | |
- API_URL | |
environment: | |
- NGINX_PORT=80 | |
- LETSENCRYPT_EMAIL="[email protected]" | |
- TICKETS_HOST | |
- LETSENCRYPT_HOST | |
- VIRTUAL_HOST | |
expose: | |
- "80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Я хочу из одного compose-файла деплоить на один и тот же хост dev и staging | |
Имена контейнеров и образов отличаются на $NODE_TAG | |
Однако, при деплое почему-то контейнер с другим тегом убивают и вместо того, чтобы рядом запустить два с разными тегами - работает только один. | |
Отчего так ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment