privateone commited on
Commit
5e60232
·
verified ·
1 Parent(s): 48500af

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -43
Dockerfile CHANGED
@@ -1,43 +1,40 @@
1
- #FROM dperson/openvpn-client
2
- FROM nikolaik/python-nodejs:python3.9-nodejs18
3
-
4
- ENV USERNAME=admin
5
- # Create and use a non-root user
6
- RUN useradd -ms /bin/bash $USERNAME
7
-
8
- # Set working directory for the application
9
- WORKDIR /app
10
-
11
-
12
- RUN apt-get update -y && apt-get upgrade -y \
13
- && apt-get install -y --no-install-recommends ffmpeg \
14
- #&& apt-get install -y openvpn \
15
- && apt-get install -y git-all \
16
- && apt-get clean \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- ENV HOME=/home/$USERNAME
20
- RUN mkdir $HOME/.cache $HOME/.config \
21
- && chmod -R 777 $HOME
22
-
23
- ENV PATH=$HOME/.local/bin:$PATH
24
-
25
- COPY init.sh /app/init.sh
26
- RUN chmod +x /app/init.sh
27
- RUN /app/init.sh
28
-
29
- # Set ownership and permissions for the app directory
30
- RUN chown -R admin:admin /app && chmod -R 777 /app
31
-
32
- # Switch to the non-root user for better security
33
- USER admin
34
-
35
- # Expose the port the application will run on
36
- EXPOSE 7860
37
-
38
- # Use init.sh as the entrypoint so it runs on container start
39
- ENTRYPOINT ["/app/init.sh"]
40
- # Run the VPN script when the container starts
41
-
42
- #CMD ["sh","/start_vpn.sh"]
43
- CMD ["python", "-u","-m", "YukkiMusic"]
 
1
+ FROM nikolaik/python-nodejs:python3.9-nodejs18
2
+
3
+ ENV USERNAME=admin
4
+
5
+ # Create and use a non-root user
6
+ RUN useradd -ms /bin/bash $USERNAME
7
+
8
+ WORKDIR /app
9
+
10
+ # install required packages in one layer
11
+ RUN apt-get update -y && apt-get upgrade -y \
12
+ && apt-get install -y --no-install-recommends ffmpeg git-all \
13
+ && apt-get clean \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ ENV HOME=/home/$USERNAME
17
+ RUN mkdir -p $HOME/.cache $HOME/.config \
18
+ && chmod -R 777 $HOME
19
+
20
+ ENV PATH=$HOME/.local/bin:$PATH
21
+
22
+ # copy init script
23
+ COPY init.sh /app/init.sh
24
+
25
+ # Ensure line endings are unix-style and script is executable, then run it
26
+ RUN sed -i 's/\r$//' /app/init.sh \
27
+ && chmod +x /app/init.sh \
28
+ && echo "---- init.sh head ----" && head -n 3 /app/init.sh || true \
29
+ && /bin/bash /app/init.sh
30
+
31
+ # Set ownership and permissions for the app directory
32
+ RUN chown -R admin:admin /app && chmod -R 777 /app
33
+
34
+ # Switch to non-root user
35
+ USER admin
36
+
37
+ EXPOSE 7860
38
+
39
+ ENTRYPOINT ["/app/init.sh"]
40
+ CMD ["python", "-u", "-m", "YukkiMusic"]