-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (40 loc) · 3.04 KB
/
Dockerfile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM postgres:12-alpine
WORKDIR /scripts
COPY scripts/setup_user.sql /scripts
COPY scripts/salesdb /scripts/salesdb
RUN cat /scripts/salesdb/*.sql > /tmp/sales.sql
RUN echo "psql -U postgres -f /tmp/sales.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d salesdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
COPY scripts/chartsdb /scripts/chartsdb
COPY scripts/chartsdb/data /scripts/chartsdb/data
RUN cat /scripts/chartsdb/*.sql > /tmp/chartsdb.sql
RUN echo "createdb chartsdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d chartsdb -U postgres -f /tmp/chartsdb.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d chartsdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
ADD scripts/webinars /tmp/
RUN echo "createdb webinarsdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d webinarsdb -U postgres -f /tmp/webinarsdb.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d webinarsdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
COPY scripts/marketingdb /scripts/marketingdb
RUN cat /scripts/marketingdb/*.sql > /tmp/marketingdb.sql
RUN echo "createdb marketingdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d marketingdb -U postgres -f /tmp/marketingdb.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d marketingdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
COPY scripts/setoperationsdb /scripts/setoperationsdb
RUN cat /scripts/setoperationsdb/*.sql > /tmp/setoperationsdb.sql
RUN echo "createdb setoperationsdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d setoperationsdb -U postgres -f /tmp/setoperationsdb.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d setoperationsdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
ADD scripts/flightsdb/flightsdb.tar.xz /tmp/
RUN echo "createdb flightsdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d flightsdb -U postgres -f /tmp/flightsdb.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d flightsdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh
COPY scripts/coursesdb /scripts/coursesdb
RUN echo "createdb coursesdb" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/schema.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/users.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/topics.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/courses.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/course_members.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/coursesdb/course_reviews.sql" >> /docker-entrypoint-initdb.d/run.sh
RUN echo "psql -d coursesdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh