Upload files to "/"

add dockerfile + compose
This commit is contained in:
2025-11-14 08:30:10 +00:00
parent b5eacacef2
commit e93c2258d7
2 changed files with 108 additions and 0 deletions

65
Dockerfile Normal file
View File

@@ -0,0 +1,65 @@
# # Pilih image dasar untuk Node.js versi 20
# FROM node:20
# # Set direktori kerja di dalam container
# WORKDIR /app
# # Salin package.json dan package-lock.json ke dalam container
# COPY qris_bank_jatim/package*.json ./
# # Install dependencies
# RUN npm install
# # Install nuxt.js secara global (jika belum ada)
# RUN npm install -g nuxt
# # Salin semua file dari folder aplikasi ke dalam container
# COPY qris_bank_jatim/ /app/
# # Expose port yang digunakan aplikasi (biasanya 3000 untuk Nuxt.js)
# EXPOSE 3000
# # Jalankan aplikasi menggunakan Nuxt.js
# CMD ["nuxt", "dev"]
# # Use Node.js 20 Alpine for smaller image
# FROM node:20-alpine
# # Set working directory
# WORKDIR /app
# # Copy package files
# COPY qris_bank_jatim/package*.json ./
# # Install dependencies
# RUN npm install
# # Copy source code
# COPY qris_bank_jatim/ ./
# # Expose port
# EXPOSE 3000
# # Start the development server
# CMD ["npm", "run", "dev"]
FROM node:20-alpine
WORKDIR /app
# Install system dependencies including SQLite and build tools
RUN apk add --no-cache \
python3 \
make \
g++ \
sqlite \
sqlite-dev
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]

43
docker-compose.yml Normal file
View File

@@ -0,0 +1,43 @@
# services:
# web:
# build:
# context: .
# dockerfile: Dockerfile
# container_name: qris_bank_jatim
# ports:
# - "3000:3000"
# volumes:
# - ./qris_bank_jatim:/app
# environment:
# - NODE_ENV=development
# command: npm run dev
# working_dir: /app
# networks:
# - qris-network
# networks:
# qris-network:
# driver: bridge
services:
web:
build:
context: .
dockerfile: Dockerfile
container_name: qris_bank_jatim
ports:
- "3000:3000"
volumes:
# Only mount source code, exclude node_modules
- ./qris_bank_jatim:/app
- /app/node_modules # Prevent host node_modules from overriding container's
environment:
- NODE_ENV=development
- HOST=0.0.0.0
working_dir: /app
networks:
- qris-network
networks:
qris-network:
driver: bridge