File size: 1,321 Bytes
3909e6d
 
 
 
 
 
5cb4b9d
3909e6d
 
 
f456099
3909e6d
 
 
 
 
 
f456099
 
3909e6d
 
 
37e2c5c
3909e6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Alpine as the base image
FROM python:3.10-alpine

# Install system dependencies and libraries required for Samba, LDAP, Webmin, and Gradio
RUN apk update && apk add --no-cache \
    bash \
    perl \
    samba \
    libsasl \
    libldap \
    openldap-dev \                
    libressl-dev \
    build-base \
    python3-dev \
    libffi-dev \
    gcc \
    musl-dev \
    openldap-dev \                
    samba-client \                
    && pip install --no-cache-dir \
    gradio \
    ldap3 \
    smbprotocol 

# Install Webmin (manually as it isn't available in Alpine's package manager)
RUN apk add --no-cache wget && \
    wget https://github.com/webmin/webmin/releases/download/1.979/webmin-1.979.tar.gz && \
    tar -xvzf webmin-1.979.tar.gz && \
    cd webmin-1.979 && \
    ./setup.sh /usr/local/webmin && \
    rm -rf /webmin-1.979 /webmin-1.979.tar.gz

# Create the directory for the app
WORKDIR /app

# Copy the Gradio app code into the container
COPY gradio_app.py /app/gradio_app.py

# Expose required ports: Webmin (10000), Gradio (7860), and Samba (445)
EXPOSE 7860 10000 445

# Provision Samba Domain (optional)
RUN samba-domain-provision

# Add a script to manage Samba, Webmin, and Gradio
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Start Samba, Webmin, and Gradio
CMD ["/start.sh"]