diff --git a/Dockerfile b/Dockerfile index e47d852..03dfb78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime as a parent image -FROM python:3.10 +FROM python:3.11.7-slim-bookworm # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 @@ -13,13 +13,11 @@ WORKDIR /app COPY . /app # Install any needed packages specified in requirements.txt -RUN pip install --upgrade pip -RUN pip install --no-cache-dir -r requirements.txt -RUN python manage.py collectstatic --noinput +RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt && python manage.py collectstatic --noinput # Copy the startup script -COPY start.sh /app/ -RUN chmod +x /app/start.sh +# COPY start.sh /app/ +# RUN chmod +x /app/start.sh # Make port 8000 available to the world outside this container EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index 1faf90f..cab173e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,18 @@ -version: '3' - -services: - web: - build: . - command: sh -c "/app/start.sh" - volumes: - - .:/app - - ./media:/app/media - ports: - - "${PORT}:8000" - environment: - - DEBUG=${DEBUG} - - PORT=${PORT} - -volumes: - media: \ No newline at end of file +version: '3' + +services: + web: + restart: unless-stopped + build: . + command: sh -c "/app/start.sh" + volumes: + - .:/app + - ./media:/app/media + ports: + - "${PORT}:8000" + environment: + - DEBUG=${DEBUG} + - PORT=8000 + +volumes: + media: