Add nginx postgres files
This commit is contained in:
parent
341de7596e
commit
2de44782f7
3 changed files with 38 additions and 0 deletions
11
nginx/Dockerfile
Normal file
11
nginx/Dockerfile
Normal file
|
@ -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;"]
|
18
nginx/nginx.conf
Normal file
18
nginx/nginx.conf
Normal file
|
@ -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/;
|
||||||
|
}
|
||||||
|
}
|
9
postgres/Dockerfile
Normal file
9
postgres/Dockerfile
Normal file
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue