Skip to content

Commit cc21450

Browse files
committed
update swarm config after filming
1 parent 02933b7 commit cc21450

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

12-deploying-containers/docker-swarm/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ compose-down:
1515

1616
### DOCKER SWARM
1717

18-
DOCKER_HOST:="ssh://ubuntu@212.2.244.220"
18+
DOCKER_HOST:="ssh://ubuntu@212.2.244.152"
1919

2020
.PHONY: swarm-init
2121
swarm-init:
@@ -35,5 +35,9 @@ swarm-remove-stack:
3535

3636
.PHONY: create-secrets
3737
create-secrets:
38-
echo -n "foobarbaz" | DOCKER_HOST=${DOCKER_HOST} docker secret create postgres-passwd -
39-
echo -n "postgres://postgres:foobarbaz@db:5432/postgres" | DOCKER_HOST=${DOCKER_HOST} docker secret create database-url -
38+
printf "foobarbaz" | DOCKER_HOST=${DOCKER_HOST} docker secret create postgres-passwd -
39+
printf "postgres://postgres:foobarbaz@db:5432/postgres" | DOCKER_HOST=${DOCKER_HOST} docker secret create database-url -
40+
41+
.PHONY: delete-secrets
42+
delete-secrets:
43+
DOCKER_HOST=${DOCKER_HOST} docker secret rm postgres-passwd database-url

12-deploying-containers/docker-swarm/docker-swarm.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
version: '3.7'
2-
32
services:
43
client-react-nginx:
54
image: sidpalas/devops-directive-docker-course-client-react-nginx:5
@@ -8,6 +7,7 @@ services:
87
replicas: 1
98
update_config:
109
order: start-first
10+
init: true
1111
networks:
1212
- frontend
1313
ports:
@@ -26,15 +26,14 @@ services:
2626
replicas: 1
2727
update_config:
2828
order: start-first
29+
init: true
2930
environment:
3031
- DATABASE_URL_FILE=/run/secrets/database-url
3132
secrets:
3233
- database-url
3334
networks:
3435
- frontend
3536
- backend
36-
ports:
37-
- 3000:3000
3837
healthcheck:
3938
test: ["CMD", "node", "/usr/src/app/healthcheck.js"]
4039
interval: 30s
@@ -49,16 +48,14 @@ services:
4948
replicas: 2
5049
update_config:
5150
order: start-first
52-
networks:
53-
- frontend
54-
- backend
5551
init: true
5652
environment:
5753
- DATABASE_URL_FILE=/run/secrets/database-url
5854
secrets:
5955
- database-url
60-
ports:
61-
- 8080:8080
56+
networks:
57+
- frontend
58+
- backend
6259
healthcheck:
6360
test: ["CMD", "/healthcheck"]
6461
interval: 30s
@@ -67,10 +64,6 @@ services:
6764
start_period: 10s
6865
db:
6966
image: postgres:15.1-alpine
70-
networks:
71-
- backend
72-
ports:
73-
- 5432:5432
7467
volumes:
7568
- pgdata:/var/lib/postgresql/data
7669
environment:
@@ -83,16 +76,15 @@ services:
8376
interval: 10s
8477
timeout: 5s
8578
retries: 5
86-
79+
networks:
80+
- backend
8781
volumes:
8882
pgdata:
89-
9083
networks:
9184
frontend:
9285
backend:
93-
9486
secrets:
9587
database-url:
9688
external: true
9789
postgres-passwd:
98-
external: true
90+
external: true

0 commit comments

Comments
 (0)