-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Use the official Python slim image
FROM python:3.12.4-slim
LABEL version="24.08.07.16.24"
# Set work directory
WORKDIR /app
# Install system dependencies including CMake and tree for debugging
RUN apt-get update && apt-get install -y \
# file \
bash \
# gcc \
# g++ \
# cmake \
# make \
# tree \
&& rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /app/callbacks
RUN mkdir -p /app/data
RUN mkdir -p /app/cfg
# Copy requirements and setup files
COPY requirements.txt .
# Install requirements
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project directory
COPY *.py /app
COPY callbacks/*.py /app/callbacks
# Debug: Print directory contents after copy
RUN echo "Contents of /app after COPY:" && ls -la /app
# Create a non-root user
RUN useradd -m appuser
# Make sure the application files are accessible to any user
RUN chmod -R 755 /app
RUN chown -R appuser:appuser /app/data
# Expose the port the app runs on
EXPOSE 8003
# Switch to non-root user
USER appuser
# Use JSON format for CMD
CMD ["sh", "-c", "python -u oodash.py"]