1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-24 07:19:36 +02:00
AdventureLog/backend/Dockerfile

41 lines
1 KiB
Text
Raw Normal View History

2024-10-25 22:57:10 -04:00
# Use the official Python slim image as the base image
2024-07-08 11:44:39 -04:00
FROM python:3.10-slim
LABEL Developers="Sean Morley"
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory
WORKDIR /code
2024-10-25 22:57:10 -04:00
# Install system dependencies (Nginx included)
2024-07-08 11:44:39 -04:00
RUN apt-get update \
2024-10-25 22:57:10 -04:00
&& apt-get install -y git postgresql-client gdal-bin libgdal-dev nginx \
2024-07-08 11:44:39 -04:00
&& apt-get clean
# Install Python dependencies
COPY ./server/requirements.txt /code/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy the Django project code into the Docker image
COPY ./server /code/
2024-10-25 22:57:10 -04:00
# Copy Nginx configuration
COPY ./nginx.conf /etc/nginx/nginx.conf
2024-08-20 14:37:18 -04:00
# Collect static files
RUN python3 manage.py collectstatic --noinput --verbosity 2
2024-07-08 11:44:39 -04:00
# Set the entrypoint script
COPY ./entrypoint.sh /code/entrypoint.sh
RUN chmod +x /code/entrypoint.sh
2024-10-25 22:57:10 -04:00
# Expose ports for NGINX and Gunicorn
EXPOSE 80 8000
# Command to start Nginx and Gunicorn
CMD ["bash", "-c", "service nginx start && /code/entrypoint.sh"]