FROM nikolaik/python-nodejs:python3.7-nodejs15-slim AS base
WORKDIR /opt/program

RUN apt-get update && apt-get install -y --no-install-recommends \
    make \
    zip \
    git \
    nginx \
    ca-certificates \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# PYTHONUNBUFFERED keeps Python from buffering our standard output stream,
# which means that logs can be delivered to the user quickly.
# PYTHONDONTWRITEBYTECODE keeps Python from writing the .pyc files which are unnecessary in this case.
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PYTHONPATH="/opt/program"

ENV PATH="/opt/program:/opt/program/inference:/opt/program/echo:/:${PATH}"

COPY pyproject.toml poetry.* *.whl ./
RUN poetry install --no-root --no-dev

COPY . .
