-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.playground
32 lines (24 loc) · 1022 Bytes
/
Dockerfile.playground
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
FROM python:3.7.12-buster
# Install Poetry for better python dependency management and packaging
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry \
python - && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
WORKDIR /workspace/
# Copy the python package to the container
COPY ./audio_classifier/ /workspace/
# Use this command for development purposes
RUN poetry install --no-root --no-interaction \
&& rm -rf ~/.cache/pypoetry/{cache,artifacts}
# Since we dont have a internal PyPi repo installing locally
RUN poetry build \
&& pip install $(find ./dist -name '*.tar.gz') \
&& rm -rf dist
# Run flake8 linting and unti tests of the package for sanity check
RUN tox -e flake8-linting \
&& tox
# Cleanup workspace
RUN rm -r ${WORKSPACE}*
# Install MLFlow for remote tracking since we don't want to add this dependency to the audio_classifier
RUN python -m pip install mlflow