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
|
||||
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
|
||||
|
|
|
@ -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:
|
||||
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:
|
||||
|
|
Loading…
Reference in New Issue