-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.heroku
41 lines (28 loc) · 1.07 KB
/
Dockerfile.heroku
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
# Use the official lightweight Python image from the DockerHub
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory
ENV APP_HOME /app
WORKDIR $APP_HOME
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Copy the New Relic configuration file
COPY newrelic.ini /app/newrelic.ini
# Set the New Relic configuration file environment variable
ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini
ENV NEW_RELIC_ENV=production
ENV PORT 8080
# Copy the firebase credentials from the build environment
COPY firebase-credentials.json /app/firebase-credentials.json
# Set the GOOGLE_APPLICATION_CREDENTIALS environment variable
ENV GOOGLE_APPLICATION_CREDENTIALS=/app/firebase-credentials.json
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.api:app --host 0.0.0.0 --port ${PORT} --workers 4 --log-level info"]