-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (38 loc) · 1023 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Base image
FROM python:3.9-alpine
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache \
bash \
build-base \
gcc \
linux-headers \
musl-dev \
postgresql \
postgresql-contrib \
postgresql-dev \
python3-dev \
supervisor \
nginx \
openssl \
su-exec \
curl \
net-tools
# Copy the application code
COPY . .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Copy SSL certificates
COPY certs/server.crt /etc/ssl/certs/server.crt
COPY certs/server.key /etc/ssl/private/server.key
# Copy supervisord.conf
COPY supervisord.conf /etc/supervisord.conf
# Ensure the logs directory exists
RUN mkdir -p /var/log/postgresql && mkdir -p /var/log/fastapi
# Expose port 443 for HTTPS
EXPOSE 443
# Entrypoint to initialize PostgreSQL and start Supervisor
ENTRYPOINT ["/bin/bash", "-c", "supervisord -n -c /etc/supervisord.conf"]