Azeez98 commited on
Commit
b0f6f18
·
verified ·
1 Parent(s): a7a22ae

Create app/Dockerfile

Browse files
Files changed (1) hide show
  1. app/Dockerfile +24 -0
app/Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a smaller base image
2
+ FROM python:3.9-alpine
3
+
4
+ # Set work directory
5
+ WORKDIR /usr/src/app
6
+
7
+ # Set environment variables
8
+ ENV PYTHONDONTWRITEBYTECODE 1
9
+ ENV PYTHONUNBUFFERED 1
10
+
11
+ # Install system dependencies
12
+ RUN apk update && \
13
+ apk add --no-cache postgresql-dev gcc python3-dev musl-dev libjpeg zlib-dev
14
+
15
+ # Install dependencies
16
+ COPY ./requirements.txt .
17
+ RUN pip install --upgrade pip && \
18
+ pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Remove the build dependencies to reduce image size
21
+ RUN apk del gcc python3-dev musl-dev
22
+
23
+ # Create a directory for static files
24
+ RUN mkdir /usr/src/app/staticfiles