-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
41 lines (30 loc) · 1.35 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
FROM python:3.10-slim
WORKDIR /usr/src/
ENV PYTHONPATH "${PYTHONPATH}:/usr/src"
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV POETRY_VERSION 1.5.0
ENV POETRY_HOME /opt/poetry
ENV POETRY_VIRTUALENVS_IN_PROJECT true
ENV POETRY_CACHE_DIR /usr/src/.cache
ENV VIRTUAL_ENVIRONMENT_PATH /usr/src/.venv
LABEL org.opencontainers.image.authors='[email protected]' \
org.opencontainers.image.url='https://github.com/bocabitlabs/buho-stocks/pkgs/container/buho-stocks' \
org.opencontainers.image.documentation='https://bocabitlabs.github.io/buho-stocks/' \
org.opencontainers.image.source="https://github.com/bocabitlabs/buho-stocks" \
org.opencontainers.image.vendor='Bocabitlabs (Rene Fernandez)' \
org.opencontainers.image.licenses='GPL-3.0-or-later'
# Required to have netcat-openbsd
RUN apt-get update
RUN apt-get install default-libmysqlclient-dev netcat-openbsd gcc pkg-config -y
# Install Poetry and dependencies
COPY pyproject.toml ./
COPY poetry.lock ./
# Using Poetry to install dependencies without requiring the project main files to be present
RUN pip install poetry==${POETRY_VERSION} && poetry install --only main --no-root --no-directory
COPY ./backend /usr/src/app
COPY ./etc /usr/src/etc
RUN chmod +x /usr/src/etc/entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/usr/src/etc/entrypoint.sh"]