forked from ReturnFI/Hysteria2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (27 loc) · 753 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
41
FROM python:3.9-slim
# environment variables
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
sudo \
cron \
iptables \
iproute2 \
dnsutils \
jq \
&& rm -rf /var/lib/apt/lists/*
# non-root user for security
RUN useradd -m hysteria2user
# working directory
WORKDIR /home/hysteria2user
COPY --chown=hysteria2user:hysteria2user . .
RUN chmod +x install.sh upgrade.sh menu.sh
# Pre-set default configuration to avoid user input
RUN mkdir -p /etc/hysteria && \
echo '{"port": 443, "sni": "bts.com"}' > /etc/hysteria/config.json
# without requiring user input
RUN yes '' | ./install.sh
EXPOSE 443
USER hysteria2user
CMD ["bash", "menu.sh"]