Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +6 -10
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# Use Python as the base image
|
| 2 |
FROM python:3.12-slim-bookworm
|
| 3 |
|
| 4 |
# Create app user and directory
|
|
@@ -8,27 +7,24 @@ RUN useradd -m appuser && \
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN apt-get update && \
|
| 13 |
-
apt-get install -y --no-install-recommends git && \
|
| 14 |
git clone https://github.com/SeoulDroid99100/lmate/ . && \
|
| 15 |
rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
#
|
| 18 |
USER appuser
|
| 19 |
RUN python -m venv venv
|
| 20 |
ENV PATH="/app/venv/bin:$PATH"
|
| 21 |
|
| 22 |
-
# Install Python dependencies
|
| 23 |
-
RUN pip install -r requirements.txt
|
| 24 |
-
|
| 25 |
-
# Set environment variables for MongoDB connection
|
| 26 |
-
ENV MONGO_URI="mongodb://mongodb:27017"
|
| 27 |
-
|
| 28 |
# Create log directory with write permissions
|
| 29 |
USER root
|
| 30 |
RUN mkdir -p /app/logs && chmod 777 /app/logs
|
| 31 |
USER appuser
|
| 32 |
|
|
|
|
|
|
|
|
|
|
| 33 |
# Run from module
|
| 34 |
CMD ["python", "-m", "shivu"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.12-slim-bookworm
|
| 2 |
|
| 3 |
# Create app user and directory
|
|
|
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# Install build dependencies and git, clone repo (keeping build dependencies)
|
| 11 |
RUN apt-get update && \
|
| 12 |
+
apt-get install -y --no-install-recommends git gcc python3-dev && \
|
| 13 |
git clone https://github.com/SeoulDroid99100/lmate/ . && \
|
| 14 |
rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Switch to appuser and set up virtual environment
|
| 17 |
USER appuser
|
| 18 |
RUN python -m venv venv
|
| 19 |
ENV PATH="/app/venv/bin:$PATH"
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Create log directory with write permissions
|
| 22 |
USER root
|
| 23 |
RUN mkdir -p /app/logs && chmod 777 /app/logs
|
| 24 |
USER appuser
|
| 25 |
|
| 26 |
+
ENV ADMINS="6783092268"
|
| 27 |
+
RUN pip install -r requirements.txt
|
| 28 |
+
|
| 29 |
# Run from module
|
| 30 |
CMD ["python", "-m", "shivu"]
|