diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..3548e84 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,11 @@ +# Use the official Nginx image from the Docker Hub +FROM nginx:latest + +# Copy custom configuration file to Nginx configuration directory +COPY ./nginx/nginx.conf /etc/nginx/nginx.conf + +# Expose port +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..fbd7119 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,18 @@ +# nginx.conf + +# Default server configuration +server { + listen 80; + server_name localhost; + + location / { + # Forward requests to the uWSGI server + uwsgi_pass unix:/app/myapp.sock; + include /etc/nginx/uwsgi_params; + } + + location /static/ { + # Serve static files from the Django app + alias /app/static/; + } +} diff --git a/postgres/Dockerfile b/postgres/Dockerfile new file mode 100644 index 0000000..effc3e0 --- /dev/null +++ b/postgres/Dockerfile @@ -0,0 +1,9 @@ +# Use the official PostgreSQL image from the Docker Hub +FROM postgres:latest + +# Copy custom configuration file to PostgreSQL configuration directory +COPY ./postgres/postgresql.conf /etc/postgresql/postgresql.conf + +# Set the Unix socket directory +RUN echo "unix_socket_directories = '/var/run/postgresql'" >> /etc/postgresql/postgresql.conf +