Starchik commited on
Commit
e7b6c23
·
verified ·
1 Parent(s): a3ae640

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -15
Dockerfile CHANGED
@@ -1,19 +1,15 @@
1
- FROM ubuntu:latest
2
 
3
- RUN apt-get update && apt-get install -y \
4
- openssh-server \
5
- python3 \
6
- python3-pip && \
7
- mkdir /var/run/sshd
8
 
9
- RUN echo 'root:rootpassword' | chpasswd
 
 
 
10
 
11
- # Разрешаем root-доступ по SSH
12
- RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
13
 
14
- # Разрешаем использование пароля
15
- RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
16
-
17
- EXPOSE 22
18
-
19
- CMD ["/usr/sbin/sshd", "-D"]
 
1
+ FROM python:3.9-slim
2
 
3
+ # Устанавливаем зависимости
4
+ RUN apt update && apt install -y openssh-server && rm -rf /var/lib/apt/lists/*
 
 
 
5
 
6
+ # Устанавливаем Python-зависимости
7
+ COPY requirements.txt /app/requirements.txt
8
+ WORKDIR /app
9
+ RUN pip install -r requirements.txt
10
 
11
+ # Копируем код
12
+ COPY app.py /app/app.py
13
 
14
+ # Запускаем сервер
15
+ CMD ["python", "app.py"]