-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
47 lines (37 loc) · 1.21 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
FROM debian:bookworm-slim as base
RUN apt-get update && apt-get install -y \
build-essential \
g++ \
gcc \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
FROM base as builder
ENV NODE_VERSION=12.22.12
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& npm install -g yarn
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
FROM builder as build
ARG PUBLIC_PATH
COPY . /code
WORKDIR /code
RUN yarn && yarn build tutor
FROM build as ui-testing
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
FROM nginx as serve
COPY --from=build /code/tutor/dist/. /usr/share/nginx/html
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf