File size: 895 Bytes
fa9f516
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5587f07
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM ubuntu:22.04

# Critical: Install tools one by one to avoid cache crash
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    curl git wget openssh-server apache2 tmate php libapache2-mod-php net-tools sudo

# Port 7860 logic (Must for HF)
RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf && \
    sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf

# Permissions logic - ekbare shob fix kora
RUN mkdir -p /var/run/sshd /var/run/apache2 /var/lock/apache2 /var/log/apache2 && \
    chmod -R 777 /var/run/apache2 /var/lock/apache2 /var/log/apache2 /var/www/html /etc/ssh

# SSH password setup directly in RUN
RUN echo 'root:shishir123' | chpasswd && \
    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

EXPOSE 7860

# Start command
CMD service ssh start && apachectl -D FOREGROUND
CMD service ssh start && apachectl start && tmate -F