StocksForecasting / Dockerfile
arithescientist's picture
Update Dockerfile
7a59e7a verified
raw
history blame contribute delete
617 Bytes
FROM python:3.11.0
# Install git-lfs and update
RUN apt-get update && apt-get install -y git-lfs && git lfs install
# Create non-root user
RUN useradd -m -u 1000 user
WORKDIR /app
# Copy and install dependencies
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application code
COPY --chown=user . /app
# Pull LFS content (if any)
RUN git lfs pull || echo 'No LFS to pull'
# Expose Flask port
EXPOSE 7860
# Run textblob corpora download at container startup
CMD ["sh", "-c", "python -m nltk.downloader punkt punkt_tab && python app.py"]