forked from AstarNetwork/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (24 loc) · 920 Bytes
/
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
FROM ubuntu:18.04 as builder
# Install any needed packages
RUN apt-get update && \
apt-get install --no-install-recommends -y curl git gnupg ca-certificates
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install --no-install-recommends -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN npm install yarn -g
WORKDIR /apps
COPY . .
RUN yarn && NODE_ENV=production yarn build:www
# ===========================================================
FROM nginx:stable-alpine
# The following is mainly for doc purpose to show which ENV is supported
ENV WS_URL=
WORKDIR /usr/share/nginx/html
COPY env.sh .
RUN apk add --no-cache bash; chmod x env.sh
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /apps/packages/apps/build /usr/share/nginx/html
EXPOSE 80
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]