Compare commits
10 Commits
1204156dd3
...
c0001f43a4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0001f43a4 | ||
![]() |
609a786e51 | ||
![]() |
1d94994b97 | ||
![]() |
dcde7c5918 | ||
![]() |
61d54b5d4b | ||
![]() |
2678766ba9 | ||
f768bd549a | |||
![]() |
c34175b262 | ||
![]() |
db691ae411 | ||
![]() |
f5e91977e7 |
@ -7,7 +7,7 @@ services:
|
|||||||
image: mathwave/sprint-repo:battleship-nginx
|
image: mathwave/sprint-repo:battleship-nginx
|
||||||
networks:
|
networks:
|
||||||
- battleship-net
|
- battleship-net
|
||||||
- battleship-nginx
|
- common-infra-nginx
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
restart_policy:
|
restart_policy:
|
||||||
@ -53,5 +53,5 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
battleship-net:
|
battleship-net:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
battleship-nginx:
|
common-infra-nginx:
|
||||||
external: true
|
external: true
|
||||||
|
@ -3,18 +3,15 @@ version: "3.4"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
nginx:
|
battleship-nginx:
|
||||||
image: mathwave/sprint-repo:battleship-nginx
|
image: mathwave/sprint-repo:battleship-nginx
|
||||||
networks:
|
networks:
|
||||||
- battleship-net
|
- battleship-net
|
||||||
ports:
|
- common-infra-nginx
|
||||||
- "1236:80"
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
placement:
|
|
||||||
constraints: [node.role == manager]
|
|
||||||
update_config:
|
update_config:
|
||||||
parallelism: 1
|
parallelism: 1
|
||||||
order: start-first
|
order: start-first
|
||||||
@ -55,3 +52,5 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
battleship-net:
|
battleship-net:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
|
common-infra-nginx:
|
||||||
|
external: true
|
@ -1,5 +1,6 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- test
|
||||||
- deploy-dev
|
- deploy-dev
|
||||||
- deploy-prod
|
- deploy-prod
|
||||||
|
|
||||||
@ -15,10 +16,16 @@ build:
|
|||||||
- docker build -t mathwave/sprint-repo:battleship-nginx nginx
|
- docker build -t mathwave/sprint-repo:battleship-nginx nginx
|
||||||
- docker push mathwave/sprint-repo:battleship-nginx
|
- docker push mathwave/sprint-repo:battleship-nginx
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
tags:
|
||||||
|
- dev
|
||||||
|
script:
|
||||||
|
- docker run --rm mathwave/sprint-repo:battleship-back pytest tests
|
||||||
|
|
||||||
.deploy:
|
.deploy:
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
|
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
|
||||||
- docker network create -d overlay --attachable battleship-nginx || true
|
|
||||||
|
|
||||||
deploy-dev:
|
deploy-dev:
|
||||||
extends:
|
extends:
|
||||||
@ -31,7 +38,7 @@ deploy-dev:
|
|||||||
when: on_success
|
when: on_success
|
||||||
- when: manual
|
- when: manual
|
||||||
script:
|
script:
|
||||||
- docker stack deploy -c ./.deploy/deploy-dev.yaml battleship
|
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml battleship
|
||||||
|
|
||||||
deploy-prod:
|
deploy-prod:
|
||||||
extends:
|
extends:
|
||||||
@ -43,4 +50,4 @@ deploy-prod:
|
|||||||
- master
|
- master
|
||||||
when: manual
|
when: manual
|
||||||
script:
|
script:
|
||||||
- docker stack deploy -c ./.deploy/deploy-prod.yaml battleship
|
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml battleship
|
||||||
|
@ -2,7 +2,7 @@ events {}
|
|||||||
|
|
||||||
http {
|
http {
|
||||||
server {
|
server {
|
||||||
listen 1236;
|
listen 1238;
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend:8000/api/;
|
proxy_pass http://backend:8000/api/;
|
||||||
|
Loading…
Reference in New Issue
Block a user