Skip to content

Commit

Permalink
Fix database startup
Browse files Browse the repository at this point in the history
  • Loading branch information
dolevf committed Nov 11, 2023
1 parent bfd0679 commit 907f393
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lab/machines/c-db-01/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ LABEL company="ACME Infinity Servers"

# Variables
ENV DEBIAN_FRONTEND=noninteractive
ENV DB_ADMINER_FILE="/var/www/html/database.sql"
ENV DB_CUSTOMERS_FILE="/var/tmp/customers.sql"

# Install Required Packages
RUN apt-get update -y --fix-missing
Expand All @@ -29,10 +31,8 @@ RUN chmod 777 /var/www/html/uploads
# Entry
ENTRYPOINT service mariadb restart \
&& \
cat /var/www/html/database.sql | mysql -u root \
if [[ -f "${DB_ADMINER_FILE}" ]]; then cat "${DB_ADMINER_FILE}" | mysql -u root; fi \
&& \
cat /var/tmp/customers.sql | mysql -u root \
&& \
rm /var/tmp/customers.sql \
if [[ -f "${DB_CUSTOMERS_FILE}" ]]; then cat "${DB_CUSTOMERS_FILE}" | mysql -u root; rm "${DB_CUSTOMERS_FILE}"; fi \
&& \
/usr/sbin/apache2ctl -D FOREGROUND

0 comments on commit 907f393

Please sign in to comment.