-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 767 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (24 loc) · 767 Bytes
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
FROM python:3.12-slim
WORKDIR /librarysite
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY Pipfile Pipfile.lock ./
RUN pip install --no-cache-dir pipenv && \
pipenv install --deploy --system
# Copy application code
COPY librarysite/ ./librarysite/
# Copy and set up entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
WORKDIR /librarysite/librarysite
# Expose only the Django port
EXPOSE 8000
# Use entrypoint for setup tasks
ENTRYPOINT ["docker-entrypoint.sh"]
# Only start Django
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]