-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.server
41 lines (32 loc) · 1.13 KB
/
Dockerfile.server
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 debian:bookworm-slim
ENV SSH_PUBLIC_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYtTh3Z4dllW6CjUXb5hzRR+/akTd4Xp8Q+gH//uSQI"
WORKDIR /opt/estkme-cloud
RUN set -xe \
&& apt-get update \
&& apt-get install -y --no-install-recommends supervisor openssh-server \
&& apt-get clean \
&& mkdir -p /var/run/sshd \
&& sed -i 's/^#\(PermitRootLogin\) .*/\1 yes/' /etc/ssh/sshd_config \
&& sed -i 's/^#\(PubkeyAuthentication\) .*/\1 yes/' /etc/ssh/sshd_config \
&& mkdir -p /root/.ssh \
&& echo "$SSH_PUBLIC_KEY" > /root/.ssh/authorized_keys \
&& chmod 600 /root/.ssh/authorized_keys \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& cat > /etc/supervisor/supervisord.conf <<'_EOF'
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/tmp/supervisord.pid
[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
[unix_http_server]
file=/tmp/supervisor.sock
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[include]
files=/etc/supervisor/conf.d/*.conf
_EOF
EXPOSE 22 1888
CMD ["sh", "-c", "/usr/sbin/sshd; /usr/bin/supervisord"]