dracoox commited on
Commit
05cb51e
·
verified ·
1 Parent(s): c7458b1

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # Install required packages
6
+ RUN apt update && apt install -y \
7
+ tzdata \
8
+ iproute2 \
9
+ net-tools \
10
+ curl \
11
+ iptables \
12
+ ca-certificates \
13
+ sudo \
14
+ python3 \
15
+ python3-pip \
16
+ && ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \
17
+ && echo "Etc/UTC" > /etc/timezone \
18
+ && dpkg-reconfigure -f noninteractive tzdata \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Create user
22
+ RUN useradd -m -s /bin/bash user && \
23
+ echo 'user:yourpassword' | chpasswd && \
24
+ echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
25
+ RUN mkdir -p /var/run/tailscale
26
+ # Install Tailscale
27
+ RUN curl -fsSL https://tailscale.com/install.sh | sh
28
+
29
+ # Install Python dependencies
30
+ RUN pip3 install flask gunicorn
31
+
32
+ # Set working directory
33
+ WORKDIR /app
34
+
35
+ # Copy app files
36
+ COPY app.py /app
37
+ COPY run.sh /app
38
+ RUN chmod +x /app/run.sh
39
+
40
+ # Expose Flask port
41
+ EXPOSE 7860
42
+
43
+ # Default command
44
+ CMD ["/app/run.sh"]