-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.direct
25 lines (22 loc) · 987 Bytes
/
Dockerfile.direct
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
# Change the value to ensure that the code generation is rerun
ARG CACHEBUST=1
# The location - relative to inside of the docker image - of the TDR OpenApi Yaml to use
ARG TDR_OPEN_API_YAML_LOCATION=https://jade.datarepo-dev.broadinstitute.org/data-repository-openapi.yaml
## Step 1. Run code generation
FROM openapitools/openapi-generator-cli:v6.2.1 as codegen
ARG CACHEBUST
ARG TDR_OPEN_API_YAML_LOCATION
RUN /usr/local/bin/docker-entrypoint.sh generate -g typescript-axios -i $TDR_OPEN_API_YAML_LOCATION -o /local/src/generated/tdr --skip-validate-spec
## Step 2. Build the deployable UI artifacts
FROM node:20.11.0-buster as build
# Copy the local code
COPY . /
# Copy the generated code
COPY --from=codegen /local /
# Run the build
RUN export DISABLE_ESLINT_PLUGIN=true && \
npm ci && \
npm run build-no-code-gen
## Step 3. Copy the static UI artifacts into an nginx image to host
FROM nginxinc/nginx-unprivileged:stable-alpine
COPY --from=build /build /usr/share/nginx/html