forked from bitshares/bitshares-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (72 loc) · 2.57 KB
/
Dockerfile
File metadata and controls
75 lines (72 loc) · 2.57 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM node:16-alpine AS dependencies
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
RUN apk add make gcc g++ git
WORKDIR /app
COPY . .
RUN yarn
RUN npm run build
FROM node:16-alpine AS release
WORKDIR /app
COPY --from=dependencies /app/build/dist* /app/
ENV NGINX_VERSION=1.19.0
RUN \
build_pkgs="build-base linux-headers openssl-dev pcre-dev wget zlib-dev" && \
runtime_pkgs="ca-certificates openssl pcre zlib tzdata git" && \
apk --no-cache add ${build_pkgs} ${runtime_pkgs} && \
cd /tmp && \
wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar xzf nginx-${NGINX_VERSION}.tar.gz && \
cd /tmp/nginx-${NGINX_VERSION} && \
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-http_slice_module \
--with-http_v2_module && \
make CFLAGS=-Wno-error CPPFLAGS=-Wno-error CXXFLAGS=-Wno-error && \
make install && \
sed -i -e 's/#access_log logs\/access.log main;/access_log \/dev\/stdout;/' -e 's/#error_log logs\/error.log notice;/error_log stderr notice;/' /etc/nginx/nginx.conf && \
addgroup -S nginx && \
adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx && \
rm -rf /tmp/* && \
apk del ${build_pkgs} && \
rm -rf /var/cache/apk/*
COPY conf/nginx.conf /etc/nginx/nginx.conf
VOLUME ["/var/cache/nginx"]
EXPOSE 80
CMD ["nginx"]