This repository was archived by the owner on Jul 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (33 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
38 lines (33 loc) · 1.48 KB
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
# Build lua modules
FROM openresty/openresty:1.15.8.2-7-bionic-nosse42 as build
WORKDIR /build
RUN mkdir -p 'lualdap' && curl -sL "https://github.com/lualdap/lualdap/archive/v1.2.5.tar.gz" | tar -zx -C 'lualdap' --strip-components 1 && \
mkdir -p /build/bin/usr/local/openresty/luajit/ && \
apt-get update && apt-get install -y \
rsync libldap2-dev libyaml-dev && \
luarocks install router --local && \
luarocks install lua-resty-session --local && \
luarocks install lua-resty-http --local && \
luarocks --server=http://rocks.moonscript.org install lyaml --local && \
(cd lualdap && luarocks build --local) && \
rsync -av /root/.luarocks/ /build/bin/usr/local/openresty/luajit/
# Build frontend
FROM node:lts-alpine as ui-build
RUN npm install -g @vue/cli && \
yarn global add @vue/cli-service-global
COPY frontend /build
RUN cd /build && npm install && npm run build
# Target container
FROM openresty/openresty:1.15.8.2-7-bionic-nosse42
RUN mkdir -p /www && \
apt-get update && apt-get install -y --no-install-recommends \
libyaml-0-2 \
libldap-2.4-2 && \
cp /usr/local/openresty/nginx/conf/* /etc/nginx/ && \
rm -rf /var/lib/apt/lists/* /etc/nginx/conf.d/default.conf
COPY --from=build /build/bin /
COPY --from=ui-build /build/dist /www/dashboard/content
COPY nginx /etc/nginx
COPY backend/lualib /usr/local/openresty/site/lualib
COPY backend/site /usr/local/openresty/nginx
CMD ["/usr/local/openresty/bin/openresty", "-c", "/etc/nginx/nginx.conf"]