Skip to content

Commit

Permalink
move condition to run
Browse files Browse the repository at this point in the history
  • Loading branch information
dolevf committed Nov 22, 2023
1 parent 945ac77 commit 4df39b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lab/machines/c-db-01/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ COPY files/customers.sql $DB_CUSTOMERS_FILE
RUN mkdir /var/www/html/uploads
RUN chmod 777 /var/www/html/uploads

# Entry
ENTRYPOINT service mariadb restart \
RUN service mariadb restart \
&& \
if [[ -f "$DB_ADMINER_FILE" ]]; then cat "$DB_ADMINER_FILE" | mysql -u root; fi \
cat "$DB_ADMINER_FILE" | mysql -u root \
&& \
if [[ -f "$DB_CUSTOMERS_FILE" ]]; then cat "$DB_CUSTOMERS_FILE" | mysql -u root; rm "$DB_CUSTOMERS_FILE"; fi \
cat "$DB_CUSTOMERS_FILE" | mysql -u root && rm "$DB_CUSTOMERS_FILE"

# Entry
ENTRYPOINT service mariadb restart \
&& \
/usr/sbin/apache2ctl -D FOREGROUND

0 comments on commit 4df39b3

Please sign in to comment.