Skip to content

Instantly share code, notes, and snippets.

@salma71
Created October 27, 2020 21:12
Show Gist options
  • Save salma71/b70547d3069667699fcbffb0443bbc41 to your computer and use it in GitHub Desktop.
Save salma71/b70547d3069667699fcbffb0443bbc41 to your computer and use it in GitHub Desktop.
FROM python:3.6.4
# Create the user that will run the app
RUN adduser --disabled-password --gecos '' ml-api-user
WORKDIR /opt/ml_api
ARG PIP_EXTRA_INDEX_URL
ENV FLASK_APP run.py
# Install requirements, including from Gemfury
ADD ./packages/ml_api /opt/ml_api/
RUN pip install --upgrade pip
RUN pip install -r /opt/ml_api/requirements.txt
RUN chmod +x /opt/ml_api/run.sh
RUN chown -R ml-api-user:ml-api-user ./
USER ml-api-user
EXPOSE 5000
CMD ["bash", "./run.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment