-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (24 loc) · 870 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
# Use the official Python image as the base image
FROM python:3.10
# Set the working directory
WORKDIR /app
# Create a virtual environment
RUN python -m venv venv
# Activate the virtual environment and set the script as executable
RUN chmod +x venv/bin/activate && \
. venv/bin/activate && \
pip install --no-cache-dir --upgrade pip
# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your Django application code
COPY . .
COPY sshd_config /etc/ssh/
# Start and enable SSH
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd \
&& chmod u+x /app/init_container.sh
EXPOSE 8000 2222
ENTRYPOINT [ "/app/init_container.sh" ]