summaryrefslogtreecommitdiffstats
path: root/deliveries/Dockerfile.mariadb
blob: c20af0c77a0e34794908fe52d33535f3c7c80264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM mariadb:10.4.14

ARG DB_SCRIPT_DIR=${DB_SCRIPT_DIR}

# constant
#Add config file
COPY my.cnf /etc/mysql/my.cnf

# mysql user and group already created by mariadb image

ARG user=mysql
ARG group=mysql

RUN mkdir /opt/$user && chown -R $user:$group /opt/$user

# Scripts are executed in alphabetical order

# Portal DDL and DML at v3.3
COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_3_3_OS.sql     /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_3_Common.sql /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_3_3_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_3_Common.sql       /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_3_3_OS.sql           /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_3_Common.sql       /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_3_3_OS.sql           /docker-entrypoint-initdb.d/

RUN chown $user:$group /opt /var -R
RUN chmod 777 /var/lib/mysql

USER mysql