Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files123456789101112131415161718192021# 1. Use PythonFROM python:3.9# 2. Set up the folderWORKDIR /code# 3. Install dependenciesCOPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# 4. Copy your app codeCOPY . /code# 5. Create a user (Security requirement for Hugging Face)RUN useradd -m -u 1000 userUSER userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH# 6. Run the app on port 7860CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]123456789101112131415161718192021# 1. Use Python ImageFROM python:3.9# 2. Set Working DirectoryWORKDIR /code# 3. Copy Requirements & InstallCOPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# 4. COPY EVERYTHING (This copies index.html, app.py, and your src/ folder)COPY . /code# 5. Create User (Hugging Face Security Requirement)RUN useradd -m -u 1000 userUSER userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH# 6. Run the App using the new filename 'app.py'CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+6-6