web-humas-fe/Dockerfile

99 lines
1.7 KiB
Docker
Raw Normal View History

2025-02-13 08:39:43 +00:00
# FROM node:23.5.0-alpine
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# ENV PORT 4000
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# # pnpm install globally
# RUN npm install -g pnpm
2025-02-10 02:14:15 +00:00
2025-02-13 08:39:43 +00:00
# # Create app directory
# RUN mkdir -p /usr/src/app
# WORKDIR /usr/src/app
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# # Installing dependencies
# COPY package.json pnpm-lock.yaml ./
2025-02-10 02:13:37 +00:00
2025-02-13 08:39:43 +00:00
# # Copy ckeditor5 to workdir
# COPY vendor/ckeditor5 ./vendor/ckeditor5
2025-02-10 02:27:20 +00:00
2025-02-13 08:39:43 +00:00
# # Install dependencies
# RUN pnpm install --frozen-lockfile
2025-02-13 08:33:37 +00:00
2025-02-13 08:39:43 +00:00
# # RUN npm install --force
# # RUN npm install -g npm@latest
# # RUN npm install
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# # Copying source files
# COPY . .
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# # Building app
# RUN pnpm run build
2025-02-10 02:13:37 +00:00
2025-02-13 08:39:43 +00:00
# EXPOSE 4000
2024-03-28 02:25:28 +00:00
2025-02-13 08:39:43 +00:00
# # Running the app
# CMD ["pnpm", "run", "start"]
2025-02-13 08:33:37 +00:00
# FROM node:23.5.0-alpine
# ENV PORT 4000
# # Install Yarn globally
# # RUN npm install -g yarn
# # Create app directory
# RUN mkdir -p /usr/src/app
# WORKDIR /usr/src/app
# # Copy package.json and yarn.lock
# COPY package.json yarn.lock ./
# # Copy ckeditor5 to workdir
# COPY vendor/ckeditor5 ./vendor/ckeditor5
# # Install dependencies
# RUN yarn install --frozen-lockfile
# # Copying source files
# COPY . .
# # Building app
# RUN yarn build
# EXPOSE 4000
# # Running the app
2025-02-13 08:39:43 +00:00
# CMD ["yarn", "start"]
# Gunakan image Node.js
FROM node:23.5.0-alpine
# Tentukan port yang akan digunakan
ENV PORT 4000
# Buat direktori aplikasi
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Salin file package.json dan lock file
COPY package.json package-lock.json ./
# Salin ckeditor5 ke dalam workdir
2025-05-16 09:28:35 +00:00
COPY vendor/ckeditor5 ./vendor/ckeditor5
2025-02-13 08:39:43 +00:00
# Instal dependensi
2025-02-13 09:50:05 +00:00
RUN npm install -g npm@latest
RUN npm install next --legacy-peer-deps
2025-02-13 08:39:43 +00:00
# Salin semua file proyek
2025-02-13 09:50:05 +00:00
# COPY . .
COPY . /usr/src/app
2025-02-13 08:39:43 +00:00
# Bangun aplikasi
RUN npm run build
# Ekspos port aplikasi
EXPOSE 4000
# Jalankan aplikasi
CMD ["npm", "run", "start"]