forked from molgenis/molgenis-emx2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (35 loc) · 1.27 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
####
## Build file for server side rendered (ssr) catalogue application for use with molgenis EMX2 backend
###
## Base image to have a node runtime ( todo replace with smaller/minimal image)
FROM node:lts-gallium
## Copy the files need from the contaxt into to image
COPY ./nuxt-ssr /app/nuxt-ssr
COPY ./molgenis-components /app/molgenis-components
COPY ssr-package.json /app
COPY yarn.lock /app
WORKDIR /app
## Rename to default name ( alt name needed to avoid multiple package.json in same gradle-docker context)
RUN mv ssr-package.json package.json
## Install the dependencies in the image
RUN yarn install
## Make the components css available to the nuxt server
COPY ./molgenis-components/dist/style.css /app/nuxt-ssr/assets/css
## Copy the same lock file used in main build to ssr build context
COPY yarn.lock /app/nuxt-ssr
WORKDIR /app/nuxt-ssr
## Generate both server and client in production mode
RUN yarn build
# Expose $PORT on container.
# We use a varibale here as the port is something that can differ on the environment.
EXPOSE $PORT
# Set host to localhost / the docker image
ENV NUXT_HOST=0.0.0.0
# Set app port
ENV NUXT_PORT=$PORT
# Set the base url
ENV PROXY_API=$PROXY_API
# Set the browser base url
ENV PROXY_LOGIN=$PROXY_LOGIN
## Start the server
CMD yarn start