File size: 1,325 Bytes
149c88e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
# Use Latest Node.js LTS base image with Debian
FROM node:22-bullseye

# Environment variables
ENV TZ=Asia/Jakarta \
    DEBIAN_FRONTEND=noninteractive \
    PORT=7860 \
    MADE=DITZDEV

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    imagemagick \
    webp \
    python3 \
    python3-pip \
    git \
    ca-certificates \
    fonts-liberation \
    fonts-dejavu \
    fonts-noto-color-emoji \
    # Clean up
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

# Set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Create app directory
WORKDIR /app

# Clone private repo using a secret
RUN --mount=type=secret,id=GITHUB_REPO,required=true \
    git clone $(cat /run/secrets/GITHUB_REPO) DITZDEV-YT

# Set working directory to cloned repo
WORKDIR /app/DITZDEV-YT

# Install Node.js dependencies
COPY package*.json ./
RUN npm ci --only=production \
    && npm cache clean --force

# Install Python dependencies (if needed)
# COPY requirements.txt ./
# RUN python3 -m pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Set permissions
RUN chmod -R 777 /app

# Test & install
RUN pwd
RUN ls
RUN npm i

# Expose port
EXPOSE 7860

# Start the application
CMD ["npm", "run", "dev"]