mosquito-app / Dockerfile
Chenyi Fei
initial upload
48ab0fd
# Use the official Julia image as base
FROM julia:1.9
# Create a non-root user (Hugging Face requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:/opt/venv/bin:$PATH
WORKDIR $HOME/app
# Switch to root temporarily to install system packages
USER root
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Create virtual env and fix permissions
RUN python3 -m venv /opt/venv && chown -R user:user /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Back to non-root user for the rest
USER user
# Copy files
COPY --chown=user . .
# Install Python & Julia packages
RUN pip install --no-cache-dir -r requirements.txt
RUN julia -e 'using Pkg; Pkg.add(["Oxygen", "HTTP", "Interpolations", "JLD", "MAT", "JSON", "DifferentialEquations"])'
# HF only listens to 7860
EXPOSE 7860
# Ensure your python app.py is configured to run on port 7860
CMD ["sh", "-c", "julia server.jl & sleep 5 && python app.py"]