docker restart:unless-stopped
parent
77464b20da
commit
a5ad54b655
10
Dockerfile
10
Dockerfile
|
@ -1,5 +1,5 @@
|
||||||
# Use an official Python runtime as a parent image
|
# Use an official Python runtime as a parent image
|
||||||
FROM python:3.10
|
FROM python:3.11.7-slim-bookworm
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
@ -13,13 +13,11 @@ WORKDIR /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install any needed packages specified in requirements.txt
|
# Install any needed packages specified in requirements.txt
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt && python manage.py collectstatic --noinput
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
RUN python manage.py collectstatic --noinput
|
|
||||||
|
|
||||||
# Copy the startup script
|
# Copy the startup script
|
||||||
COPY start.sh /app/
|
# COPY start.sh /app/
|
||||||
RUN chmod +x /app/start.sh
|
# RUN chmod +x /app/start.sh
|
||||||
|
|
||||||
# Make port 8000 available to the world outside this container
|
# Make port 8000 available to the world outside this container
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
|
@ -2,6 +2,7 @@ version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
|
restart: unless-stopped
|
||||||
build: .
|
build: .
|
||||||
command: sh -c "/app/start.sh"
|
command: sh -c "/app/start.sh"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -11,7 +12,7 @@ services:
|
||||||
- "${PORT}:8000"
|
- "${PORT}:8000"
|
||||||
environment:
|
environment:
|
||||||
- DEBUG=${DEBUG}
|
- DEBUG=${DEBUG}
|
||||||
- PORT=${PORT}
|
- PORT=8000
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
media:
|
media:
|
Loading…
Reference in New Issue