Update
Browse files- Dockerfile +63 -0
Dockerfile
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Latest Node.js LTS base image with Debian
|
| 2 |
+
FROM node:22-bullseye
|
| 3 |
+
|
| 4 |
+
# Environment variables
|
| 5 |
+
ENV TZ=Asia/Jakarta \
|
| 6 |
+
DEBIAN_FRONTEND=noninteractive \
|
| 7 |
+
PORT=7860 \
|
| 8 |
+
MADE=DITZDEV
|
| 9 |
+
|
| 10 |
+
# Install system dependencies
|
| 11 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
+
ffmpeg \
|
| 13 |
+
imagemagick \
|
| 14 |
+
webp \
|
| 15 |
+
python3 \
|
| 16 |
+
python3-pip \
|
| 17 |
+
git \
|
| 18 |
+
ca-certificates \
|
| 19 |
+
fonts-liberation \
|
| 20 |
+
fonts-dejavu \
|
| 21 |
+
fonts-noto-color-emoji \
|
| 22 |
+
# Clean up
|
| 23 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 24 |
+
&& apt-get clean
|
| 25 |
+
|
| 26 |
+
# Set timezone
|
| 27 |
+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
| 28 |
+
|
| 29 |
+
# Create app directory
|
| 30 |
+
WORKDIR /app
|
| 31 |
+
|
| 32 |
+
# Clone private repo using a secret
|
| 33 |
+
RUN --mount=type=secret,id=GITHUB_REPO,required=true \
|
| 34 |
+
git clone $(cat /run/secrets/GITHUB_REPO) DITZDEV-YT
|
| 35 |
+
|
| 36 |
+
# Set working directory to cloned repo
|
| 37 |
+
WORKDIR /app/DITZDEV-YT
|
| 38 |
+
|
| 39 |
+
# Install Node.js dependencies
|
| 40 |
+
COPY package*.json ./
|
| 41 |
+
RUN npm ci --only=production \
|
| 42 |
+
&& npm cache clean --force
|
| 43 |
+
|
| 44 |
+
# Install Python dependencies (if needed)
|
| 45 |
+
# COPY requirements.txt ./
|
| 46 |
+
# RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
| 47 |
+
|
| 48 |
+
# Copy application code
|
| 49 |
+
COPY . .
|
| 50 |
+
|
| 51 |
+
# Set permissions
|
| 52 |
+
RUN chmod -R 777 /app
|
| 53 |
+
|
| 54 |
+
# Test & install
|
| 55 |
+
RUN pwd
|
| 56 |
+
RUN ls
|
| 57 |
+
RUN npm i
|
| 58 |
+
|
| 59 |
+
# Expose port
|
| 60 |
+
EXPOSE 7860
|
| 61 |
+
|
| 62 |
+
# Start the application
|
| 63 |
+
CMD ["npm", "run", "dev"]
|