Skip to content

Instantly share code, notes, and snippets.

@arihantdaga
Last active January 16, 2021 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arihantdaga/3f8b7818b511c86e7bd3470389d38d22 to your computer and use it in GitHub Desktop.
Save arihantdaga/3f8b7818b511c86e7bd3470389d38d22 to your computer and use it in GitHub Desktop.
# base Image
FROM python:3.6-stretch
# install build utilities
RUN apt-get update && \
apt-get install -y gcc make apt-transport-https ca-certificates build-essential git
#Install Pytorch and dependencies
RUN pip3 install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
# set the working directory for containers
WORKDIR /usr/src/moodtagging
# Installing python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Define Flask Environment
ENV FLASK_APP server.py
ENV FLASK_RUN_HOST=0.0.0.0
WORKDIR /code
# Copy all the files from the project’s root to the working directory
COPY requirements.txt requirements.txt
COPY . .
RUN pip install -r requirements.txt
# Expose Port
EXPOSE 5005
# Running Python Application
ENTRYPOINT ["python3"]
CMD ["src/server.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment