File size: 1,133 Bytes
8a572af
 
 
 
 
 
 
 
 
 
b947639
8a572af
447a21e
6368afd
2bbf077
 
 
447a21e
6368afd
 
 
447a21e
 
 
2bbf077
 
6368afd
 
8a572af
 
 
 
 
 
 
 
 
00e0ee2
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
FROM python:3.12.2

# Set workdir
WORKDIR /app

# Copy files
COPY requirements.txt requirements.txt
COPY templates/ /app/templates/
COPY static/ /app/static
COPY merge_sql_nosql.py merge_sql_nosql.py
COPY app.py app.py

# Install system dependencies + Microsoft ODBC Driver 17 (modern method)
RUN apt-get update && apt-get install -y \
    curl \
    apt-transport-https \
    gnupg \
    lsb-release \
    unixodbc \
    unixodbc-dev \
    libodbc1 \
    && curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft.gpg \
    && echo "deb [signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/debian/12/prod bookworm main" \
        > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
    && rm -rf /var/lib/apt/lists/*

# Install dependencies
RUN pip install -r requirements.txt
RUN mkdir -p /app/cache /app/uploads /app/data && chmod -R 777 /app/cache /app/uploads /app/data
RUN mkdir -p /static
RUN chmod -R 777 /app

# Expose default port for Spaces
EXPOSE 7860

CMD ["python", "app.py"]