sentiment_analysis / Dockerfile
Johnniewhite's picture
Update Dockerfile
d6d2ef0 verified
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
# 4. Install dependencies
RUN pip install -r requirements.txt
# 5. Optionally install TensorFlow for GPU support (if available)
RUN if [ $(command -v nvidia-smi) ]; then pip install tensorflow-gpu; else pip install tensorflow; fi
# 6. Copy application code
COPY index.py ./
# 7. Expose port for Flask app
EXPOSE 5000
# 8. Start the Flask app
CMD ["python", "index.py"]
CMD ["uvicorn", "index:app", "--host", "0.0.0.0", "--port", "7860"]