-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (36 loc) · 1.22 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
FROM rustlang/rust:nightly as builder
COPY rust-doh /src/
WORKDIR /src/
RUN cargo update \
&& cargo build --release
FROM debian:stretch
LABEL version="1.0.0" \
maintainer="Leonardo Barcaroli <leo.barcaroli@gmail.com>" \
description="A docker image to host one's DNS-over-HTTPS proxy"
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /etc/doh/ \
&& mkdir -p /var/www/letsencrypt \
&& chown -R www-data:www-data /var/www/letsencrypt \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nginx \
supervisor \
certbot \
python3-pip \
python3-setuptools \
python3-pkg-resources \
&& pip3 --no-cache-dir install reload \
&& rm -rf /etc/nginx/sites-*/default \
&& rm -rf /var/lib/apt/lists/*
COPY set_log_format.sh /srv/
COPY letsencrypt-wrapper.sh /srv/
COPY doh-wrapper.sh /srv/
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY doh.conf /etc/nginx/conf.d/
COPY pass_to_doh /etc/nginx/conf.d/
COPY --from=builder /src/target/release/doh-proxy /srv/
RUN /srv/set_log_format.sh /etc/nginx/nginx.conf
VOLUME ["/var/www/letsencrypt", "/var/log", "/etc/letsencrypt"]
EXPOSE "80"
EXPOSE "443"
ENTRYPOINT ["/usr/bin/supervisord"]