for4 / Dockerfile
ken4's picture
Upload 2 files
0125bfa verified
raw
history blame contribute delete
680 Bytes
FROM node:18-bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
tar screen htop bmon wget perl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /home/container
COPY api.tar.gz .
# Ekstrak tar.gz dan salin isi folder Rest-APIs ke /home/container
RUN mkdir /tmp/api \
&& tar -xzf api.tar.gz -C /tmp/api \
&& cp -r /tmp/api/Rest-APIs/* /home/container \
&& rm -rf /tmp/api api.tar.gz
RUN npm install --production --silent && npm cache clean --force
RUN chmod -R 777 /home/container
# Set environment port
ENV PORT=7860
EXPOSE 7860
# Jalankan server.js langsung (tanpa PM2)
CMD ["node", "server.js"]