-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
63 lines (50 loc) · 1.44 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Use an official Python runtime as a parent image
FROM python:3.11-slim-bullseye as build
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container at /app
COPY requirements.txt /app/
COPY apps /app/
COPY media /app/
COPY multitenantsaas /app/
# COPY staticfiles /app/
COPY tests /app/
COPY .env /app/
COPY manage.py /app/
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
# Install any needed packages specified in requirements.txt
# RUN pip install --no-cache-dir -r requirements.txt
RUN pip install -r requirements.txt
# Copy the current directory contents into the container at /app
# COPY . /app/
COPY . /app/
# Run vulnerability scan on build image
# FROM build AS vulnscan
# COPY --from=aquasec/trivy:latest /usr/local/bin/trivy /usr/local/bin/trivy
# RUN trivy rootfs --no-progress /
EXPOSE 8585
EXPOSE 8000
EXPOSE 80
# ## New Solution
# FROM python:3.11.4-slim-bullseye AS BASE
# ENV PYTHONUNBUFFERED 1
# ENV PYTHONDONTWRITEBYTECODE 1
# WORKDIR /app
# COPY ./requirements.txt ./
# RUN apt-get update && \
# apt-get install -y \
# gcc \
# default-libmysqlclient-dev \
# pkg-config \
# curl && \
# pip install --no-cache-dir -r requirements.txt && \
# apt-get remove -y \
# gcc \
# pkg-config && \
# rm -rf /var/lib/apt/lists/*
# COPY . .
# EXPOSE 8000