34 lines
1.0 KiB
Docker
34 lines
1.0 KiB
Docker
# Use an official Python runtime as a parent image
|
|
FROM python:3.8-slim
|
|
|
|
# Set environment variables for Django
|
|
ENV DJANGO_SETTINGS_MODULE=plovidba_projekt.settings
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
# Install PostgreSQL development headers, build tools, and other dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y libpq-dev gcc && \
|
|
apt-get clean
|
|
|
|
# Install GDAL
|
|
RUN apt-get update \
|
|
&& apt-get install -y binutils libproj-dev gdal-bin
|
|
|
|
# Install the PostgreSQL client
|
|
RUN apt-get update && apt-get install -y postgresql-client
|
|
|
|
# Create and set the working directory in the container
|
|
WORKDIR /app/plovidba_projekt
|
|
|
|
# Copy the requirements file into the container and install dependencies
|
|
COPY requirements.txt /app/plovidba_projekt/
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Copy the rest of the application code into the container
|
|
COPY . /app/plovidba_projekt/
|
|
|
|
# Expose the port the application will run on (if necessary)
|
|
# EXPOSE 8000
|
|
|
|
# Define the default command to run when starting the container
|
|
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |