forked from opentargets/ot-ui-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (19 loc) · 766 Bytes
/
Dockerfile
File metadata and controls
20 lines (19 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM node:16-bookworm as build
# make sure app variable is set and valid
ARG app=""
RUN : "${app:?Missing --build-arg app}"
RUN case "$app" in platform) true;; genetics) true;; *) echo "variable 'app' must be set to either 'platform' or 'genetics'"; false;; esac
# assert that a compatible yarn version is installed or fail
RUN case `yarn --version` in 1.22*) true;; *) false;; esac
# COPY package.json yarn.lock /tmp/$app-app/
WORKDIR /tmp/app/
COPY . ./
RUN yarn --network-timeout 100000
RUN yarn build:$app
RUN mv ./apps/$app/bundle-$app/ ./bundle/
FROM node:16-bookworm
RUN npm install --location=global serve
COPY --from=build /tmp/app/bundle/ /var/www/app/
WORKDIR /var/www/app/
EXPOSE 80
CMD ["serve", "--no-clipboard", "--single", "-l", "tcp://0.0.0.0:80"]