2022-11-12 21:10:06 -08:00
|
|
|
# Build stage
|
|
|
|
|
|
|
|
FROM python:3.11.0-buster as builder
|
2022-11-08 20:05:51 -08:00
|
|
|
|
|
|
|
RUN mkdir -p /takahe
|
|
|
|
RUN python -m venv /takahe/.venv
|
|
|
|
RUN apt-get update && apt-get -y install libpq-dev python3-dev
|
|
|
|
|
|
|
|
WORKDIR /takahe
|
|
|
|
|
|
|
|
COPY requirements.txt requirements.txt
|
|
|
|
|
|
|
|
RUN . /takahe/.venv/bin/activate \
|
|
|
|
&& pip install --upgrade pip \
|
|
|
|
&& pip install --upgrade -r requirements.txt
|
|
|
|
|
2022-11-12 21:10:06 -08:00
|
|
|
# Final image stage
|
2022-11-08 20:05:51 -08:00
|
|
|
|
2022-11-12 21:10:06 -08:00
|
|
|
FROM python:3.11.0-slim-buster
|
2022-11-08 20:05:51 -08:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y libpq5
|
|
|
|
|
|
|
|
COPY --from=builder /takahe /takahe
|
|
|
|
COPY . /takahe
|
|
|
|
|
|
|
|
WORKDIR /takahe
|
|
|
|
EXPOSE 8000
|
|
|
|
|
2022-11-12 21:10:06 -08:00
|
|
|
CMD ["/takahe/docker/start.sh"]
|