onthego / app /Dockerfile
Azeez98's picture
Create app/Dockerfile
b0f6f18 verified
raw
history blame contribute delete
607 Bytes
# Use a smaller base image
FROM python:3.9-alpine
# Set work directory
WORKDIR /usr/src/app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apk update && \
apk add --no-cache postgresql-dev gcc python3-dev musl-dev libjpeg zlib-dev
# Install dependencies
COPY ./requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Remove the build dependencies to reduce image size
RUN apk del gcc python3-dev musl-dev
# Create a directory for static files
RUN mkdir /usr/src/app/staticfiles