-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.app
More file actions
33 lines (24 loc) · 890 Bytes
/
Dockerfile.app
File metadata and controls
33 lines (24 loc) · 890 Bytes
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 slim Python image from the Docker Hub
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Install sudo
RUN apt-get update && \
apt-get install -y sudo git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create a new user called promptlab with sudo privileges
RUN useradd -m -s /bin/bash promptlab && \
echo "promptlab ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Switch to the promptlab user
USER promptlab
# Set the working directory
WORKDIR /app
# Create a virtual environment
RUN python -m venv venv
# Copy the current directory contents into the container at /app
COPY --chown=promptlab:promptlab . /app
# Activate the virtual environment and install the requirements
RUN /bin/bash -c "source venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt"
# Run the app
CMD ["bash", "deploy.sh"]