-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
43 lines (32 loc) · 1.26 KB
/
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
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim
# Comment to trigger an image rebuild
# Optional build argument for different environments
ARG ENV
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y gcc g++ libc-dev \
postgresql-client libpq-dev make git jq libgdal-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip && pip install pipenv==2024.0.1
#TODO move to pipfile when operational
RUN pip install newrelic
# Install python dependencies
# Install everything for dev and test otherwise just core dependencies
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
RUN if [ "$ENV" = "dev" ] || [ "$ENV" = "test" ]; then \
echo "Install all dependencies" \
&& pipenv install --system --deploy --ignore-pipfile --dev; \
else \
echo "Install production dependencies only" \
&& pipenv install --system --deploy; \
fi
COPY ./app /app/app
COPY alembic.ini /app/alembic.ini
COPY app/settings/prestart.sh /app/prestart.sh
COPY app/settings/start.sh /app/start.sh
COPY newrelic.ini /app/newrelic.ini
COPY wait_for_postgres.sh /usr/local/bin/wait_for_postgres.sh
RUN chmod +x /usr/local/bin/wait_for_postgres.sh
RUN chmod +x /app/start.sh
ENTRYPOINT [ "/app/start.sh" ]