forked from aces/Loris
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test.db
More file actions
26 lines (22 loc) · 1.24 KB
/
Dockerfile.test.db
File metadata and controls
26 lines (22 loc) · 1.24 KB
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
FROM mariadb:11.8
ARG BASE_DIR
COPY SQL/ /sql/
COPY raisinbread/instruments/instrument_sql/ /instruments_sql/
COPY raisinbread/RB_files/ /RB_files/
COPY test/test_instrument/testtest.sql /test_instrument.sql
RUN cat /sql/0000-00-00-schema.sql \
/sql/0000-00-01-Modules.sql \
/sql/0000-00-02-Permission.sql \
/sql/0000-00-03-ConfigTables.sql \
/sql/0000-00-04-Help.sql \
/sql/0000-00-05-ElectrophysiologyTables.sql \
/sql/0000-00-06-BiobankTables.sql \
/instruments_sql/*.sql \
/test_instrument.sql \
/RB_files/*.sql \
> /docker-entrypoint-initdb.d/0000-compiled.sql
RUN echo "USE LorisTest;" > /docker-entrypoint-initdb.d/0001-paths.sql \
&& echo "UPDATE Config SET Value='${BASE_DIR}/' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='base');" >> /docker-entrypoint-initdb.d/0001-paths.sql \
&& echo "CREATE USER IF NOT EXISTS 'SQLTestUser'@'%' IDENTIFIED BY 'TestPassword';" >> /docker-entrypoint-initdb.d/0001-paths.sql \
&& echo "GRANT UPDATE, INSERT, SELECT, DELETE, DROP, CREATE TEMPORARY TABLES ON LorisTest.* TO 'SQLTestUser'@'%';" >> /docker-entrypoint-initdb.d/0001-paths.sql \
&& echo "FLUSH PRIVILEGES;" >> /docker-entrypoint-initdb.d/0001-paths.sql