-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (38 loc) · 947 Bytes
/
Dockerfile
File metadata and controls
46 lines (38 loc) · 947 Bytes
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
# Backend API service
FROM base
# Copy application files and configuration
COPY ./app /app/app
COPY ./workers /app/workers
COPY ./scripts /app/scripts
COPY config.toml /app/config.toml
COPY openssl.cnf /app/openssl.cnf
# Ensure the certs directory exists
RUN mkdir -p /app/certs
# Expose metrics port
EXPOSE 9090
# Create entrypoint script inline (BuildKit heredoc)
COPY <<'EOF' /entrypoint.sh
#!/bin/bash
set -e
while [ ! -f /app/certs/server.key ]; do
echo "Waiting for TLS certs..."
sleep 2
done
echo "Starting application..."
exec gunicorn 'app.main:create_app()' \
-k uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:443 \
--workers 4 \
--threads 4 \
--timeout 60 \
--graceful-timeout 30 \
--keep-alive 2 \
--backlog 2048 \
--log-level info \
--access-logfile - \
--error-logfile - \
--keyfile /app/certs/server.key \
--certfile /app/certs/server.crt
EOF
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]