File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,18 @@ if [ $# -gt 0 ]; then
210
210
sail_is_not_running
211
211
fi
212
212
213
+ # Initiate a PostgreSQL CLI terminal session within the "pgsql" container...
214
+ elif [ " $1 " == " psql" ]; then
215
+ shift 1
216
+
217
+ if [ " $EXEC " == " yes" ]; then
218
+ docker-compose exec \
219
+ pgsql \
220
+ bash -c ' PGPASSWORD=${PGPASSWORD} psql -U ${POSTGRES_USER} ${POSTGRES_DB}'
221
+ else
222
+ sail_is_not_running
223
+ fi
224
+
213
225
# Initiate a Bash shell within the application container...
214
226
elif [ " $1 " == " shell" ] || [ " $1 " == " bash" ]; then
215
227
shift 1
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ services:
19
19
- sail
20
20
depends_on :
21
21
- mysql
22
+ # - pgsql
22
23
- redis
23
24
# - selenium
24
25
# selenium:
@@ -43,6 +44,19 @@ services:
43
44
- sail
44
45
healthcheck :
45
46
test : ["CMD", "mysqladmin", "ping"]
47
+ # pgsql:
48
+ # image: postgres:13
49
+ # ports:
50
+ # - '${FORWARD_DB_PORT:-5432}:5432'
51
+ # environment:
52
+ # PGPASSWORD: '${DB_PASSWORD:-secret}'
53
+ # POSTGRES_DB: '${DB_DATABASE}'
54
+ # POSTGRES_USER: '${DB_USERNAME}'
55
+ # POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
56
+ # volumes:
57
+ # - 'sailpostgresql:/var/lib/postgresql/data'
58
+ # networks:
59
+ # - sail
46
60
redis :
47
61
image : ' redis:alpine'
48
62
ports :
@@ -72,5 +86,7 @@ networks:
72
86
volumes :
73
87
sailmysql :
74
88
driver : local
89
+ # sailpostgresql:
90
+ # driver: local
75
91
sailredis :
76
92
driver : local
You can’t perform that action at this time.
0 commit comments