Commit 902897c3 authored by Benjamin Rokseth's avatar Benjamin Rokseth
Browse files

services: remove mysql client from Dockerfile

parent 2a1439e7
...@@ -29,10 +29,6 @@ FROM java:8 ...@@ -29,10 +29,6 @@ FROM java:8
COPY --from=builder /services/build/libs/services-1.0-SNAPSHOT-standalone.jar /services-1.0-SNAPSHOT-standalone.jar COPY --from=builder /services/build/libs/services-1.0-SNAPSHOT-standalone.jar /services-1.0-SNAPSHOT-standalone.jar
RUN apt-get update && apt-get install -y \
mysql-client \
&& rm -rf /var/lib/apt/lists/*
ADD entrypoint.dev.sh /entrypoint.sh ADD entrypoint.dev.sh /entrypoint.sh
CMD /entrypoint.sh \ CMD /entrypoint.sh \
......
#!/usr/bin/env bash #!/usr/bin/env bash
# wait until database is responding and has been populated by koha web installer
while true; do
mysql --protocol=tcp -h koha_mysql -u"$KOHA_MYSQL_USER" -p"$KOHA_MYSQL_PASS" "$KOHA_MYSQL_DB" -e "SELECT 1 FROM categories,branches,borrowers LIMIT 1"
if [ $? = 0 ]; then break; fi;
sleep 3s;
done;
set -e
# Setup Koha REST api user
# ------------------------
# Add patron categories for API user and Self registrated users
mysql --protocol=tcp -h koha_mysql -u"$KOHA_MYSQL_USER" -p"$KOHA_MYSQL_PASS" "$KOHA_MYSQL_DB" -e "\
INSERT IGNORE INTO categories(categorycode, description, enrolmentperiod, upperagelimit, category_type) VALUES \
('API', 'API-user', NULL, NULL, 'S'), \
('REGVOKSEN', 'Selvregistrert voksen', 1, NULL, 'A'), \
('REGBARN', 'Selvregistrert barn', 1, 16, 'C')"
# Add branch for API user
mysql --protocol=tcp -h koha_mysql -u"$KOHA_MYSQL_USER" -p"$KOHA_MYSQL_PASS" "$KOHA_MYSQL_DB" -e "INSERT IGNORE INTO branches(branchcode, branchname) VALUES ('api', 'Intern API avdeling')"
# Add user with permissions needed for API use
mysql --protocol=tcp -h koha_mysql -u"$KOHA_MYSQL_USER" -p"$KOHA_MYSQL_PASS" "$KOHA_MYSQL_DB" -e "INSERT IGNORE INTO borrowers(surname,branchcode,cardnumber,userid,password,flags,categorycode,privacy,dateexpiry) VALUES ('$KOHA_API_USER', 'api', '$KOHA_API_USER','$KOHA_API_USER','$KOHA_API_PASS_ENCRYPTED',1,'API',1,'2199-12-31')"
# Javarunner # Javarunner
# ---------- # ----------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment