tes-api / Dockerfile
gi2h270's picture
Upload 2 files
1cd0415 verified
raw
history blame contribute delete
950 Bytes
FROM node:20-slim
# Install dependencies, Chrome, xvfb, unzip
RUN apt update && apt install -y \
wget gnupg ca-certificates xvfb unzip \
fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
libatk1.0-0 libxss1 libnss3 libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt install -y ./google-chrome-stable_current_amd64.deb \
&& rm google-chrome-stable_current_amd64.deb \
&& ln -s /usr/bin/google-chrome /usr/bin/chrome
WORKDIR /A
# Folder kerja
RUN mkdir -p /A/Api /A/cache
# Copy zip dari repo
COPY Api.zip /A/Api.zip
# Extract Api.zip → /A/Api
RUN unzip -q /A/Api.zip -d /A && rm /A/Api.zip
# Install dependency API
WORKDIR /A/Api
RUN npm install --omit=dev
EXPOSE 7860
# Jalankan API via xvfb
CMD rm -f /tmp/.X99-lock && \
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
npm start