samarth upadhyay
Update Dockerfile
454b540 verified
Raw
History Blame Contribute Delete
925 Bytes
FROM python:3.9-slim
# 1. Install Database Servers and CLIs
# We install sqlite3, postgresql-client, and mariadb-client
# Reordered slightly to ensure Docker rebuilds this layer and installs sqlite3
RUN apt-get update && apt-get install -y \
sqlite3 \
postgresql \
postgresql-client \
mariadb-server \
mariadb-client \
&& rm -rf /var/lib/apt/lists/*
# 2. Set up Python environment
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3. Copy application code & startup script
COPY app.py .
COPY start.sh .
RUN chmod +x start.sh
# 4. Fix Permissions for DB startup
RUN mkdir -p /var/run/mysqld && \
chown -R postgres:postgres /var/lib/postgresql && \
chown -R mysql:mysql /var/lib/mysql && \
chown -R mysql:mysql /var/run/mysqld
# 5. Expose the Hugging Face default port
EXPOSE 7860
# 6. Use the startup script as the entrypoint
CMD ["./start.sh"]