File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,12 @@ jobs:
28
28
curl -L "https://github.com/docker/compose/releases/download/v2.19.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
29
29
chmod +x /usr/local/bin/docker-compose
30
30
31
+ - name : Set up password
32
+ run : |
33
+ echo ${{ secrets.DB_PASSWORD }} > db-password.txt
34
+ cat db-password.txt
35
+
31
36
- name : Run Docker Compose
32
37
run : |
33
- export DB_PASSWORD=${{ secrets.DB_PASSWORD }}
34
38
export DOCKER_HOST=ssh://[email protected]
35
39
docker-compose -f ./compose.prod.yaml up -d
36
-
37
- # - name: Copy over the docker compose file
38
- # run: |
39
- # scp -o StrictHostKeyChecking=no compose.prod.yaml [email protected] :guestbook/compose.yaml
40
- # - name: Deploy code via SSH
41
- # run: |
42
- # ssh -o StrictHostKeyChecking=no [email protected] "cd guestbook && docker compose up -d"
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ services:
48
48
- " traefik.http.routers.proxy.tls.certresolver=myresolver"
49
49
# Enable watchtower
50
50
- " com.centurylinklabs.watchtower.enable=true"
51
+ secrets :
52
+ - db-password
51
53
environment :
52
54
- POSTGRES_HOST=db
53
55
- POSTGRES_PASSWORD=$DB_PASSWORD
@@ -68,10 +70,12 @@ services:
68
70
user : postgres
69
71
volumes :
70
72
- db-data:/var/lib/postgresql/data
73
+ secrets :
74
+ - db-password
71
75
environment :
72
76
- POSTGRES_DB=guestbook
73
- # - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
74
- - POSTGRES_PASSWORD=${DB_PASSWORD}
77
+ - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
78
+ # - POSTGRES_PASSWORD=${DB_PASSWORD}
75
79
expose :
76
80
- 5432
77
81
healthcheck :
@@ -84,4 +88,4 @@ volumes:
84
88
letsencrypt :
85
89
secrets :
86
90
db-password :
87
- environment : DB_PASSWORD
91
+ file : ./db-password.txt
You can’t perform that action at this time.
0 commit comments