Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_HOSTNAME=localhost
DB_HOSTNAME=db
DB_USER=root
DB_PASSWORD=abcxyz
DB_PASSWORD=root
DB_DATABASE=learning-with-texts
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ RUN docker-php-ext-install pdo pdo_mysql mysqli
COPY . /var/www/html/

# creating connect.inc.php
ARG DB_HOSTNAME
ARG DB_USER
ARG DB_PASSWORD
ARG DB_DATABASE
ARG DB_HOSTNAME=db
ARG DB_USER=root
ARG DB_PASSWORD=root
ARG DB_DATABASE=learning-with-texts
RUN printf '<?php\n$server = "%s";\n$userid = "%s";\n$passwd = "%s";\n$dbname = "%s";\n?>' "$DB_HOSTNAME" "$DB_USER" "$DB_PASSWORD" "$DB_DATABASE" > /var/www/html/connect.inc.php
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ services:
context: .
dockerfile: Dockerfile
args:
- DB_HOSTNAME
- DB_USER
- DB_PASSWORD
- DB_DATABASE
- DB_HOSTNAME=db
- DB_USER=root
- DB_PASSWORD=root
- DB_DATABASE=learning-with-texts
container_name: lwt
depends_on:
- db
links:
- db
ports:
- "8010:80"
restart: unless-stopped
Expand All @@ -26,4 +28,4 @@ services:
volumes:
- lwt_db_data:/var/lib/mysql
volumes:
lwt_db_data:
lwt_db_data: {}