-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 954 Bytes
/
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
# Use the official Python image from the Docker Hub
FROM python:3.10-slim
# Set environment variables to prevent Python from writing .pyc files
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
build-essential \
&& pip install virtualenvwrapper poetry==1.4.2 \
# libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY ["poetry.lock", "pyproject.toml","README.md", "./"]
RUN poetry install --no-root
RUN poetry add celery
# Copy the Django project into the Docker image
COPY ./canteen/ .
# Expose the port the app runs on
EXPOSE 8000
# COPY scripts/entrypoint.sh /entrypoint.sh
# RUN chmod a+x /entrypoint.sh
# CMD ["sh", "-c", "poetry run python manage.py runserver 0.0.0.0:8000 & poetry run celery -A core worker --loglevel=info"]
CMD ["sh", "-c", "poetry run python manage.py runserver 0.0.0.0:8000"]