forked from AnyVisionltd/anv-ui-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.storybook
36 lines (24 loc) · 908 Bytes
/
Dockerfile.storybook
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
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM nikolaik/python-nodejs:python3.9-nodejs14-alpine as build-stage
ENV APP_DIR /home/node/anv-ui-components
WORKDIR $APP_DIR
COPY ./ ./
## Copy Artifact certificate for login + install + build
COPY .npmrc /.npmrc
RUN npm config set registry https://anyvision.jfrog.io/anyvision/api/npm/npm/
RUN npm --verbose ci
RUN rm .npmrc
RUN PYTHON=/usr/bin/python
RUN npm run build-storybook
# ---- Release ----
FROM nginx:1.15
ENV APP_DIR /home/node/anv-ui-components
RUN apt-get update && apt-get -y install procps vim git curl net-tools
# Nginx config
RUN rm -rf /etc/nginx/conf.d
COPY conf /etc/nginx
COPY --from=build-stage $APP_DIR/storybook-static/ /usr/share/nginx/html
# Copy .env file and shell script to container
WORKDIR /usr/share/nginx/html
# Start Nginx server
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]