File size: 1,541 Bytes
c86e3a4
 
 
 
b900167
e92c3f3
d5fac92
b900167
e92c3f3
d5fac92
b900167
c86e3a4
e92c3f3
ad8f566
e92c3f3
c86e3a4
b900167
e92c3f3
d5fac92
b900167
c86e3a4
 
 
e92c3f3
c86e3a4
d5fac92
e92c3f3
c86e3a4
d5fac92
c86e3a4
77c5866
d5fac92
e92c3f3
d5fac92
 
e92c3f3
c86e3a4
e92c3f3
c86e3a4
 
 
e92c3f3
 
c86e3a4
 
e92c3f3
 
d5fac92
 
e92c3f3
c86e3a4
d5fac92
 
e92c3f3
c86e3a4
b900167
e92c3f3
c86e3a4
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
52
53
54
55
56
57
58
# Menggunakan image Ubuntu Focal sebagai base image
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive

# Set environment variables
ENV PYTHONUNBUFFERED 1

# Expose the port that the server will run on
EXPOSE 7860

# Update the package list dan upgrade existing packages
RUN apt update && apt upgrade -y

# Install required packages
RUN apt install -y curl

# Add NodeSource APT repository for Node 18.x
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

# CODE SERVER
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Install Node.js and npm
RUN apt install -y nodejs

# Install Neofetch
RUN apt install -y neofetch

# Install FFmpeg dan dependencies lainnya
RUN apt install -y ffmpeg gnupg ca-certificates build-essential software-properties-common chromium-browser

# Install additional dependencies for Puppeteer
RUN apt --yes install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0

# Install ImageMagick
RUN apt install -y imagemagick

# Create a non-root user named Nex and switch to it
RUN useradd -m -u 1000 Nex
USER Nex

# Set environment variables for the user
ENV HOME=/home/Nex \
    PATH=/home/Nex/.local/bin:$PATH

# Set the working directory
WORKDIR $HOME/app

# Copy package.json and package-lock.json files and install dependencies
COPY --chown=Nex package*.json . 
RUN npm install

# Copy the rest of the application code
COPY --chown=Nex . .

# Start the application
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]