BinaryONe commited on
Commit
491fb27
·
1 Parent(s): 7bdea2a

Nginx Changes-Over Alpine

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -5,10 +5,10 @@ RUN apk update && apk upgrade && \
5
  apk add --no-cache nginx python3 py3-pip build-base libffi-dev openssl-dev shadow
6
 
7
  # Install python/pip
8
- ENV PYTHONUNBUFFERED=1
9
- RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
10
- RUN python3 -m ensurepip
11
- RUN pip3 install --no-cache --upgrade pip setuptools
12
 
13
  # Create a group and user
14
  RUN addgroup -S appgroup && adduser -S appuser -G appgroup
@@ -24,13 +24,18 @@ COPY requirements.txt /app/requirements.txt
24
  COPY . /app
25
 
26
  # Create a virtual environment within the container
27
- RUN python3 -m venv /app/venv
 
 
 
 
 
28
 
29
  # Activate the virtual environment (important!)
30
- RUN source /app/venv/bin/activate
31
 
32
  # Install Python dependencies from the requirements file within the virtual environment
33
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
34
  #RUN pip install -r requirements.txt
35
 
36
 
 
5
  apk add --no-cache nginx python3 py3-pip build-base libffi-dev openssl-dev shadow
6
 
7
  # Install python/pip
8
+ #ENV PYTHONUNBUFFERED=1
9
+ #RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
10
+ #RUN python3 -m ensurepip
11
+ #RUN pip3 install --no-cache --upgrade pip setuptools
12
 
13
  # Create a group and user
14
  RUN addgroup -S appgroup && adduser -S appuser -G appgroup
 
24
  COPY . /app
25
 
26
  # Create a virtual environment within the container
27
+ #RUN python3 -m venv /app/venv
28
+
29
+ # Create and activate the virtual environment AND install requirements in ONE RUN command
30
+ RUN python3 -m venv /app/venv && \
31
+ /app/venv/bin/pip install --no-cache-dir --upgrade pip && \
32
+ /app/venv/bin/pip install --no-cache-dir -r /app/requirements.txt
33
 
34
  # Activate the virtual environment (important!)
35
+ #RUN source /app/venv/bin/activate
36
 
37
  # Install Python dependencies from the requirements file within the virtual environment
38
+ #RUN py3-pip install --no-cache-dir --upgrade -r requirements.txt
39
  #RUN pip install -r requirements.txt
40
 
41