forked from HBPMedical/sample-data-db-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (48 loc) · 1.94 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
55
56
57
58
59
60
# Build stage for statistics
FROM python:3.6.1-alpine as build-stats-env
RUN pip install --no-cache-dir csvkit==1.0.2
COPY sql/linreg_sample.csv /data/linreg_sample.csv
COPY sql/churn.csv \
sql/iris.csv \
sql/desd-synthdata.csv \
sql/nida-synthdata.csv \
sql/qqni-synthdata.csv \
/data/
WORKDIR /data
RUN for f in *.csv ; do csvstat $f > ${f/.csv/.stats} ; done
# Recover the jar from the parent image
FROM hbpmip/data-db-setup:2.1.9 as parent-image
# Build stage for Java classes
FROM maven:3.5.2-jdk-8-alpine as build-java-env
COPY --from=parent-image /usr/share/jars/data-db-setup.jar /flyway/jars/
COPY src/main/java/ /project/src/
WORKDIR /project/src
RUN jar uvf /flyway/jars/data-db-setup.jar -C . .
# Final image
FROM hbpmip/data-db-setup:2.1.9
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
COPY --from=build-stats-env /data /data
COPY --from=build-java-env /flyway/jars/data-db-setup.jar /flyway/jars/data-db-setup.jar
COPY sql/V1_0__create.sql \
sql/V1_1__churn.sql \
sql/V1_2__iris.sql \
sql/V1_3__dummy_ldsm.sql \
sql/V1_4__dummy_federation.sql \
sql/V1_5__synthetic_datasets.sql \
/flyway/sql/
ENV IMAGE=hbpmip/sample-data-db-setup:0.5.0 \
DATASETS=linreg_sample,churn,iris,desd_synth,nida_synth,qqni_synth
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="hbpmip/sample-data-db-setup" \
org.label-schema.description="Research database setup usin/home/hbpuserg the MIP Common Data Elements" \
org.label-schema.url="https://github.com/LREN-CHUV/sample-data-db-setup" \
org.label-schema.vcs-type="git" \
org.label-schema.vcs-url="https://github.com/LREN-CHUV/sample-data-db-setup" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version="$VERSION" \
org.label-schema.vendor="LREN CHUV" \
org.label-schema.license="Apache2.0" \
org.label-schema.docker.dockerfile="Dockerfile" \
org.label-schema.schema-version="1.0"