forked from kamranabdicse/fastapi-postgres-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackend.dockerfile
26 lines (20 loc) · 834 Bytes
/
backend.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
FROM python:3.10
WORKDIR /app/
ENV PYTHONPATH=/app
# Install Poetry version 1
RUN pip install poetry fastapi uvicorn gunicorn
RUN poetry config virtualenvs.create false
# Copy poetry.lock* in case it doesn't exist in the repo
COPY ./app/pyproject.toml ./app/poetry.lock* /app/
RUN poetry export -f requirements.txt --without-hashes --output /app/requirements.txt
RUN pip install -r requirements.txt
# Install Poetry version 2
# RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
# cd /usr/local/bin && \
# ln -s /opt/poetry/bin/poetry && \
# poetry config virtualenvs.create false
# Copy poetry.lock* in case it doesn't exist in the repo
COPY ./app/pyproject.toml ./app/poetry.lock /app/
COPY ./gunicorn_conf.py ./start-server.sh /
COPY ./app .
CMD [ "bash", "/start-server.sh" ]