Skip to content

Commit e8e002b

Browse files
author
Peter Valdez
committed
Set an explicit username/password for Postgres in the swarm and k8s files too
1 parent 7d1e4a9 commit e8e002b

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

docker-stack-simple.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ services:
1616
condition: on-failure
1717
db:
1818
image: postgres:9.4
19+
environment:
20+
POSTGRES_USER: "postgres"
21+
POSTGRES_PASSWORD: "postgres"
1922
volumes:
2023
- db-data:/var/lib/postgresql/data
2124
networks:
@@ -78,4 +81,4 @@ networks:
7881
backend:
7982

8083
volumes:
81-
db-data:
84+
db-data:

docker-stack.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ services:
1414
condition: on-failure
1515
db:
1616
image: postgres:9.4
17+
environment:
18+
POSTGRES_USER: "postgres"
19+
POSTGRES_PASSWORD: "postgres"
1720
volumes:
1821
- db-data:/var/lib/postgresql/data
1922
networks:

k8s-specifications/db-deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ spec:
1818
containers:
1919
- image: postgres:9.4
2020
name: postgres
21+
env:
22+
- name: POSTGRES_USER
23+
value: postgres
24+
- name: POSTGRES_PASSWORD
25+
value: postgres
2126
ports:
2227
- containerPort: 5432
2328
name: postgres

kube-deployment.yml

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ spec:
7777
env:
7878
- name: PGDATA
7979
value: /var/lib/postgresql/data/pgdata
80+
- name: POSTGRES_USER
81+
value: postgres
82+
- name: POSTGRES_PASSWORD
83+
value: postgres
8084
ports:
8185
- containerPort: 5432
8286
name: db

result/docker-compose.test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ services:
4747

4848
db:
4949
image: postgres:9.4
50+
environment:
51+
POSTGRES_USER: "postgres"
52+
POSTGRES_PASSWORD: "postgres"
5053
volumes:
5154
- "db-data:/var/lib/postgresql/data"
5255
networks:

0 commit comments

Comments
 (0)