forked from MetaCell/geppetto-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (36 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
FROM node:16-alpine AS build-stage
# NGINX PORT
EXPOSE 80
WORKDIR /app
# YARN REQUIRES GIT BINARY
RUN apk add git
# COPY PACKAGE MANAGEMENT FILES + DEPENDENCIES
COPY geppetto-showcase/package*.json geppetto-showcase/
COPY geppetto-showcase/yarn.lock geppetto-showcase/
COPY geppetto.js geppetto.js
# Prepare geppetto-client/core/ui dependencies
RUN yarn global add yalc
WORKDIR /app/geppetto.js/geppetto-ui
# Only build src since we parse the src files to extract e.g. React props
RUN yarn && yarn build:src && yarn publish:yalc
WORKDIR /app/geppetto.js/geppetto-core
RUN yarn && yarn build && yarn publish:yalc
WORKDIR /app/geppetto.js/geppetto-client
RUN yalc add @metacell/geppetto-meta-ui
RUN yalc add @metacell/geppetto-meta-core
RUN yarn && yarn build && yarn publish:yalc
# INSTALL PACKAGES
WORKDIR /app/geppetto-showcase
RUN yalc add @metacell/geppetto-meta-ui
RUN yalc add @metacell/geppetto-meta-client
RUN yalc add @metacell/geppetto-meta-core
RUN yarn
# COPY SOURCE CODE
COPY geppetto-showcase .
# BUILD
RUN npm run build
####################################################################
FROM nginx:alpine
COPY --from=build-stage /app/geppetto-showcase/dist/ /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY geppetto-showcase/nginx/nginx.conf /etc/nginx/conf.d