Compare commits
No commits in common. "35f364263fa781a459cf3d45a404b3b5d8808751" and "f7b0be924db7ae543cb6876e05c8229320644dd9" have entirely different histories.
35f364263f
...
f7b0be924d
26
dockerfile
26
dockerfile
@ -1,17 +1,35 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --upgrade pip && pip install -r requirements.txt
|
||||
# Install dependencies
|
||||
COPY requirements.txt /app/
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
# Copy project
|
||||
COPY . /app/
|
||||
|
||||
# Collect static files
|
||||
RUN python manage.py collectstatic --noinput
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "booking_system.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3"]
|
||||
# Run gunicorn
|
||||
CMD ["gunicorn", "booking_system.wsgi:application", "--bind", "0.0.0.0:8000"]
|
||||
```
|
||||
|
||||
**Optional: Create `.dockerignore`:**
|
||||
```
|
||||
*.pyc
|
||||
__pycache__
|
||||
db.sqlite3
|
||||
.env
|
||||
.git
|
||||
venv/
|
||||
Loading…
Reference in New Issue
Block a user