Skip to content

Commit 23f5382

Browse files
committed
Change host name for database
1 parent 89704a9 commit 23f5382

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

.env

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Postgres Live
2-
DB_HOST=postgres # used when running the app with docker
3-
# DB_HOST=127.0.0.1 # when running the app without docker
2+
DB_HOST=fullstack-postgres # used when running the app with docker
3+
# DB_HOST=127.0.0.1 # when running the app without docker
44
DB_DRIVER=postgres
5-
API_SECRET=98hbun98h # Used for creating a JWT. Can be anything
5+
API_SECRET=98hbun98h # Used for creating a JWT. Can be anything
66
DB_USER=steven
77
DB_PASSWORD=
88
DB_NAME=fullstack_api
9-
DB_PORT=5432 #Default postgres port
9+
DB_PORT=5432
1010

1111
PGADMIN_DEFAULT_EMAIL=live@admin.com
1212
PGADMIN_DEFAULT_PASSWORD=password
1313

1414
# Postgres Test
15-
TEST_DB_HOST=postgres_test # used when running the app with docker
16-
# TEST_DB_HOST=127.0.0.1 # when running the app without docker
15+
TEST_DB_HOST=postgres_test # used when running the app with docker
16+
# TEST_DB_HOST=127.0.0.1 # when running the app without docker
1717
TEST_DB_DRIVER=postgres
1818
TEST_API_SECRET=98hbun98h
1919
TEST_DB_USER=steven
@@ -23,19 +23,19 @@ TEST_DB_PORT=5432
2323

2424

2525
# # Mysql Live
26-
# DB_HOST=mysql # used when running the app with docker
27-
# # DB_HOST=127.0.0.1 # when running the app without docker
26+
# DB_HOST=fullstack-mysql # used when running the app with docker
27+
# # DB_HOST=127.0.0.1 # when running the app without docker
2828
# DB_DRIVER=mysql
29-
# API_SECRET=98hbun98h #Used for creating a JWT. Can be anything
29+
# API_SECRET=98hbun98h # Used for creating a JWT. Can be anything
3030
# DB_USER=steven
3131
# DB_PASSWORD=here
3232
# DB_NAME=fullstack_api
33-
# DB_PORT=3306 #Default mysql port
33+
# DB_PORT=3306
3434

3535

3636
# # Mysql Test
37-
# TEST_DB_HOST=mysql_test # used when running the app with docker
38-
# # TEST_DB_HOST=127.0.0.1 # when running the app without docker
37+
# TEST_DB_HOST=mysql_test # used when running the app with docker
38+
# # TEST_DB_HOST=127.0.0.1 # when running the app without docker
3939
# TEST_DB_DRIVER=mysql
4040
# TEST_API_SECRET=98hbun98h
4141
# TEST_DB_USER=steven

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ WORKDIR /root/
3434

3535
# Copy the Pre-built binary file from the previous stage
3636
COPY --from=builder /app/main .
37-
COPY --from=builder /app/.env .
37+
COPY --from=builder /app/.env .
3838

3939
# Expose port 8080 to the outside world
4040
EXPOSE 8080

docker-compose.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ services:
99
volumes:
1010
- api:/usr/src/app/
1111
depends_on:
12-
- postgres # This service depends on postgres. Start that first.
13-
# - mysql # This service depends on mysql. Start that first.
12+
- fullstack-postgres # Uncomment this when using postgres.
13+
# - fullstack-mysql # Uncomment this when using mysql.
1414
networks:
1515
- fullstack
1616

1717

18-
postgres:
18+
fullstack-postgres:
1919
image: postgres:latest
2020
container_name: full_db_postgres
2121
environment:
@@ -37,15 +37,15 @@ services:
3737
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
3838
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
3939
depends_on:
40-
- postgres
40+
- fullstack-postgres
4141
ports:
4242
- "5050:80"
4343
networks:
4444
- fullstack
4545
restart: unless-stopped
4646

4747

48-
# mysql:
48+
# fullstack-mysql:
4949
# image: mysql:5.7
5050
# container_name: full_db_mysql
5151
# ports:
@@ -65,7 +65,7 @@ services:
6565
# image: phpmyadmin/phpmyadmin
6666
# container_name: phpmyadmin_container
6767
# depends_on:
68-
# - mysql
68+
# - fullstack-mysql
6969
# environment:
7070
# - PMA_HOST=mysql # Note the "mysql". Must be the name of the what you used as the mysql service.
7171
# - PMA_USER=${DB_USER}
@@ -80,8 +80,8 @@ services:
8080

8181
volumes:
8282
api:
83-
database_postgres:
84-
# database_mysql:
83+
database_postgres: # Uncomment this when using postgres.
84+
# database_mysql: # Uncomment this when using mysql.
8585

8686
# Networks to be created to facilitate communication between containers
8787
networks:

0 commit comments

Comments
 (0)