Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM python:3.8-slim-buster
FROM python:3.8-slim-buster AS builder
# Builder stage dependencies aren't needed by the app at runtime
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc
COPY requirements.txt .
RUN pip install --upgrade pip setuptools wheel
RUN pip install -r requirements.txt

FROM python:3.8-slim-buster AS app
WORKDIR /app

RUN apt-get update \
&& apt-get -y install libpq-dev gcc \
&& pip3 install psycopg2

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

RUN apt-get update && apt-get install -y libpq5 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local/
COPY . .

CMD ["/bin/bash","run.sh"]
CMD ["/bin/bash", "run.sh"]