mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 19:55:18 +02:00
Fast. Easy. Fun. Deployment 🚀
This commit is contained in:
parent
78ab387055
commit
ef3f2aee10
3 changed files with 63 additions and 31 deletions
|
@ -1,5 +1,4 @@
|
|||
# Dockerfile
|
||||
|
||||
# Use the official Python slim image as the base image
|
||||
FROM python:3.10-slim
|
||||
|
||||
LABEL Developers="Sean Morley"
|
||||
|
@ -11,9 +10,9 @@ ENV PYTHONUNBUFFERED 1
|
|||
# Set the working directory
|
||||
WORKDIR /code
|
||||
|
||||
# Install system dependencies
|
||||
# Install system dependencies (Nginx included)
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y git postgresql-client gdal-bin libgdal-dev \
|
||||
&& apt-get install -y git postgresql-client gdal-bin libgdal-dev nginx \
|
||||
&& apt-get clean
|
||||
|
||||
# Install Python dependencies
|
||||
|
@ -24,10 +23,18 @@ RUN pip install -r requirements.txt
|
|||
# Copy the Django project code into the Docker image
|
||||
COPY ./server /code/
|
||||
|
||||
# Copy Nginx configuration
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Collect static files
|
||||
RUN python3 manage.py collectstatic --noinput --verbosity 2
|
||||
|
||||
# Set the entrypoint script
|
||||
COPY ./entrypoint.sh /code/entrypoint.sh
|
||||
RUN chmod +x /code/entrypoint.sh
|
||||
ENTRYPOINT ["/code/entrypoint.sh"]
|
||||
|
||||
# Expose ports for NGINX and Gunicorn
|
||||
EXPOSE 80 8000
|
||||
|
||||
# Command to start Nginx and Gunicorn
|
||||
CMD ["bash", "-c", "service nginx start && /code/entrypoint.sh"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue