forked from TensorBlock/forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 1.34 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (34 loc) · 1.34 KB
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
FROM python:3.12-slim
WORKDIR /app
# Define build-time arguments
ARG ARG_CLERK_JWT_PUBLIC_KEY
ARG ARG_CLERK_API_KEY
ARG ARG_CLERK_API_URL
ARG ARG_DEBUG_LOGGING=false
# Set runtime environment variables from build-time arguments
# WARNING: These values will be baked into the image. For sensitive data, prefer runtime injection.
ENV CLERK_JWT_PUBLIC_KEY=${ARG_CLERK_JWT_PUBLIC_KEY}
ENV CLERK_API_KEY=${ARG_CLERK_API_KEY}
# Example with a default value if ARG is not set for CLERK_API_URL
ENV CLERK_API_URL=${ARG_CLERK_API_URL:-https://api.clerk.dev/v1}
ENV FORGE_DEBUG_LOGGING=${ARG_DEBUG_LOGGING}
# Install system dependencies including PostgreSQL client and gosu for user privilege management
RUN apt-get update && apt-get install -y \
postgresql-client \
gosu \
&& rm -rf /var/lib/apt/lists/*
# Create logs directory
RUN mkdir -p /app/logs
# Copy project files
COPY . .
# Copy entrypoint script and make it executable
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Install dependencies using pip
RUN pip install -e ".[dev]"
# Expose port
EXPOSE 8000
# Set the entrypoint to our script
ENTRYPOINT ["docker-entrypoint.sh"]
# Run the application (this command is passed to the entrypoint)
CMD ["gunicorn", "app.main:app", "-k", "uvicorn.workers.UvicornWorker", "--workers", "10", "--bind", "0.0.0.0:8000"]