X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=deliveries%2FDockerfile.mariadb;h=8dffd0e46be130166f9404261caacdc8f565928f;hb=dc2be81a9875ce6e414136a53d55ed01a0a267e2;hp=2d79908a4a2126c1422ee423b83af58fe7271d09;hpb=f9b06313332d65f2a6600667d1b92c2ebede5453;p=portal.git diff --git a/deliveries/Dockerfile.mariadb b/deliveries/Dockerfile.mariadb index 2d79908a..8dffd0e4 100644 --- a/deliveries/Dockerfile.mariadb +++ b/deliveries/Dockerfile.mariadb @@ -1,21 +1,34 @@ FROM mariadb:latest -#Author -MAINTAINER Manoop talasila@research.att.com +ARG DB_SCRIPT_DIR=${DB_SCRIPT_DIR} -ARG SCRIPT_DIR=${SCRIPT_DIR} -ARG SDK_SCRIPT_DIR=${SDK_SCRIPT_DIR} -ARG DBC_SCRIPT_DIR=${DBC_SCRIPT_DIR} +# constant #Add config file -ADD my.cnf /etc/mysql/my.cnf -#ADD cluster.cnf /etc/mysql/conf.d +COPY my.cnf /etc/mysql/my.cnf -#Add DDL and DML SQL files -ADD ${SCRIPT_DIR}/EcompPortalDDLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompPortalDDLMySql_1610_Complete_OS.sql -ADD ${SCRIPT_DIR}/EcompPortalDMLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompPortalDMLMySql_1610_Complete_OS.sql +# mysql user and group already created by mariadb image -ADD ${SDK_SCRIPT_DIR}/EcompSdkDDLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompSdkDDLMySql_1610_Complete_OS.sql -ADD ${SDK_SCRIPT_DIR}/EcompSdkDMLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompSdkDMLMySql_1610_Complete_OS.sql +ARG user=mysql +ARG group=mysql -ADD ${DBC_SCRIPT_DIR}/EcompSdkDDLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompDbcDDLMySql_1610_Complete_OS.sql -ADD ${DBC_SCRIPT_DIR}/EcompSdkDMLMySql_1610_Complete_OS.sql docker-entrypoint-initdb.d/EcompDbcDMLMySql_1610_Complete_OS.sql +RUN mkdir /opt/$user && chown -R $user:$group /opt/$user + +# Scripts are executed in alphabetical order + +# Portal DDL and DML at v3.2 +COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_2_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_2_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ +# Do not copy the onboarding script here; it's mounted as a volume + +# SDK App DDL and DML +COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_2_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_2_Common.sql /docker-entrypoint-initdb.d/ +COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_2_OS.sql /docker-entrypoint-initdb.d/ + +RUN chown $user:$group /opt /var -R +RUN chmod 777 /var/lib/mysql + +USER mysql