-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDockerfile
40 lines (35 loc) · 939 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
37
38
39
40
# Build js / css
FROM node:22 AS yarn-dependencies
WORKDIR /srv
COPY . .
RUN yarn --network-concurrency 2
RUN yarn run build
RUN mkdir /srv/deploy
RUN mv build /srv/deploy/
RUN mv entrypoint /srv/deploy/
RUN mv haproxy-demo.cfg /srv/deploy/
# Build the demo image
FROM ubuntu:noble
# Set up environment
ENV LANG C.UTF-8
WORKDIR /srv
RUN apt-get update && apt-get install -y --no-install-recommends \
haproxy \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
libssl-dev \
wget
# Install serve
ENV NVM_DIR /usr/local/nvm
RUN mkdir /usr/local/nvm \
&& wget --no-check-certificate https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh \
&& bash install.sh \
&& . $NVM_DIR/nvm.sh \
&& nvm install v16 \
&& npm install --global serve
# Import code
COPY --from=yarn-dependencies /srv/deploy /srv
ENTRYPOINT ["./entrypoint"]