-
Notifications
You must be signed in to change notification settings - Fork 328
/
Dockerfile
46 lines (39 loc) · 1.19 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
FROM node:20 as build
# environment variables
ARG COMMIT_HASH=empty
ENV COMMIT_HASH $COMMIT_HASH
# install dependencies
WORKDIR /app
COPY package.json .
COPY pnpm-lock.yaml .
RUN corepack enable && \
corepack prepare --activate && \
pnpm install
# compile css and uikit tests
# build static files
WORKDIR /app
COPY . .
RUN pnpm compile && \
rm -rf ./build/assets/uikit/node_modules/ && \
pnpm build
# build uikit v2
FROM node:18 as build-v2
ADD https://github.com/uikit/uikit-site/releases/download/2016.12/uikit-site-v2.zip uikit.zip
RUN unzip uikit.zip -d ./uikit && \
rm uikit.zip && \
mv ./uikit ./app
WORKDIR /app
RUN yarn install && \
yarn gulp build-site && \
rm -rf ./node_modules/
# setup httpd
FROM httpd:2.4-alpine as httpd
WORKDIR /usr/local/apache2
RUN sed -i "s/ServerAdmin [email protected]/ServerAdmin [email protected]/" ./conf/httpd.conf && \
sed -i "s/AllowOverride None/AllowOverride All/" ./conf/httpd.conf && \
sed -i "/LoadModule rewrite_module/s/^#//g" ./conf/httpd.conf && \
sed -i "/LoadModule expires_module/s/^#//g" ./conf/httpd.conf
# copy htdocs
WORKDIR /usr/local/apache2/htdocs
COPY --from=build /app/build/ .
COPY --from=build-v2 /app/ ./v2