-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 1.02 KB
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
# Use an official Python runtime based on Debian 10 ("buster") as a parent image
FROM python:3.12
# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1
RUN apt-get install -y libssl-dev iputils-ping net-tools
RUN python3 -m pip install --upgrade pip
# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash
# Don't create .pyc files (why don't we want these?)
ENV PYTHONDONTWRITEBYTECODE 1
# Prevent docker from buffering console output
ENV PYTHONUNBUFFERED 1
# Install python requirements
COPY ./requirements.txt requirements.txt
RUN python3 -m pip install -r requirements.txt
# Set working directory for subsequent RUN ADD COPY CMD instructions
COPY . /app/
WORKDIR /app/
RUN adduser --disabled-password appuser && chown -R appuser:appuser /app && chmod -R 775 /app
USER appuser