-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (31 loc) · 1.29 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
# Default version if the variable is not set. The version in the .env file takes precedence.
ARG BASEL_VERSION=master
FROM ghcr.io/covid-modeling/model-runner/basel:${BASEL_VERSION} AS build
# Copy the Basel model data.
RUN mkdir -p /model/input \
&& cp /runner/src/assets/data/scenarios.json /model/input/scenarios.json
WORKDIR /connector
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
# Tell the run-basel-model wrapper executable where to find the model code.
ENV MODEL_REPO_ROOT /runner
# The run-basel-model wrapper executable is stored here.
ENV MODEL_RUNNER_BIN_DIR /connector/bin
ENV MODEL_RUNNER_LOG_DIR /data/log
ENV MODEL_DATA_DIR /model/input
ENV MODEL_INPUT_DIR /data/input
ENV MODEL_OUTPUT_DIR /data/output
ENTRYPOINT ["/connector/bin/run-model"]
####################################################################
# Do this here so that we don't have to run the tests when bulding a release.
FROM build AS release
LABEL org.opencontainers.image.source=https://github.com/covid-policy-modelling/basel-connector
####################################################################
FROM build AS test
RUN npm run test
RUN npm run integration-test
####################################################################
# Use release as the default
FROM release