noppodev commited on
Commit
a737e90
·
verified ·
1 Parent(s): 17135e4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM debian:bookworm-slim
2
+
3
+ # 必要なパッケージのインストール
4
+ # tailscale, openssh-server, sudo, curlなどを一括で入れる
5
+ RUN apt-get update && apt-get install -y \
6
+ curl \
7
+ tailscale \
8
+ openssh-server \
9
+ sudo \
10
+ python3 \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # SSHサーバーの設定
14
+ # HFの制限を考慮し、ディレクトリ作成と設定変更を行う
15
+ RUN mkdir /var/run/sshd && \
16
+ sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config && \
17
+ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
18
+ sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
19
+
20
+ # SSHログイン用パスワードの設定
21
+ # Termiusでログインする時に使うパスワードだぜ(必要に応じて変えてな!)
22
+ RUN echo 'root:noppo-ssh-pass' | chpasswd
23
+
24
+ # 起動スクリプトのコピーと権限付与
25
+ COPY entrypoint.sh /entrypoint.sh
26
+ RUN chmod +x /entrypoint.sh
27
+
28
+ # HFがWebサーバーとして認識するために必要なポート(ダミー)
29
+ EXPOSE 7860
30
+
31
+ # 起動実行
32
+ ENTRYPOINT ["/entrypoint.sh"]