File size: 1,289 Bytes
e0af25e
 
 
 
 
 
a97590e
8d4635c
e0af25e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d4635c
e0af25e
 
8d4635c
e0af25e
 
 
 
 
 
 
 
 
 
 
 
 
 
2fb515b
e0af25e
 
a97590e
e0af25e
 
20b9f77
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
# Use Latest Node.js LTS base image with Debian
FROM node:21-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-SERVER

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

# 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

# Expose port
EXPOSE 7860

# Start the application
CMD ["node", "index.js"]