This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
66 lines (50 loc) · 1.64 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM node:18.12-slim as build-stage
WORKDIR /app
COPY /frontend/package.json ./
RUN npm install
COPY /frontend/ ./
RUN npm run build
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt update &&\
apt install --no-install-recommends -y \
nginx \
curl \
unzip \
openssl \
supervisor &&\
rm -f /var/www/html/* &&\
mkdir -p /etc/nginx/routes \
/etc/nginx/certificate_conf &&\
pip install gunicorn
COPY --from=build-stage /app/dist /var/www/html
COPY configs/nginx.conf /etc/nginx/nginx.conf
COPY configs/routes.conf /etc/nginx/routes/routes.conf
COPY configs/backend.conf /etc/nginx/conf.d/backend.conf
RUN curl -L https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip -o /tmp/Xray-linux-64.zip &&\
unzip /tmp/Xray-linux-64.zip -d /tmp/xray &&\
mv /tmp/xray/geosite.dat /usr/local/bin/ &&\
mv /tmp/xray/geoip.dat /usr/local/bin/ &&\
mv /tmp/xray/xray /usr/local/bin/ &&\
chmod +x /usr/local/bin/xray &&\
rm -rf /tmp/xray
WORKDIR /x-view
COPY /backend/requirements.txt ./
RUN pip install -r requirements.txt
COPY /backend/ ./
COPY configs/run.sh /run.sh
COPY configs/supervisor /etc/supervisor
RUN chmod +x /run.sh &&\
chmod +x /etc/supervisor/stop-supervisor.sh &&\
chmod +x /x-view/healthcheck.sh
ENV NGINX_PORT 4444
VOLUME /x-view/db
RUN apt remove -y \
unzip &&\
apt autoremove -y &&\
rm -rf /var/lib/apt/lists/* &&\
mkdir /var/log/x-core
HEALTHCHECK --interval=30s --timeout=3s CMD ./healthcheck.sh
ENTRYPOINT ["/bin/bash", "/run.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]