From 6f561a69816ac4ab3b986a9efac3d7ba1804ddde Mon Sep 17 00:00:00 2001 From: SundayEnglish Date: Wed, 26 Mar 2025 11:17:04 +0700 Subject: [PATCH] deploy config --- Dockerfile | 28 ++++++++++++++++++++-------- docker-compose.yml.example | 10 +++++----- nginx/conf.d/vhost.conf | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b401e0..f2cb6df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,26 @@ +# Sử dụng image Node.js chính thức phiên bản 16 FROM node:16 -# Set working directory +# Cập nhật hệ thống và cài các công cụ cần thiết +RUN apt-get update && apt-get install -y curl gnupg + +# Nếu bạn muốn chuyển về Node.js v14, cần thay FROM node:16 bằng image khác. +# FROM node:14 + +# Làm sạch cache của apt sau khi cài +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Thiết lập thư mục làm việc WORKDIR /var/www -# get latest nodejs -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - -RUN apt-get install -y nodejs -# Install Yarn -#RUN npm install --global yarn +# COPY src/package*.json ./src/ + +# Cài đặt dependencies +# RUN cd src && npm install + +# Nếu bạn muốn cài Yarn, có thể bỏ comment dòng sau +# RUN npm install --global yarn -#npm install -#RUN bash -c "cd /var/www/src; npm install" +# Nếu bạn cần chạy ứng dụng (bỏ comment nếu cần) +# CMD ["npm", "start"] diff --git a/docker-compose.yml.example b/docker-compose.yml.example index cba7f57..2496756 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -1,13 +1,13 @@ version: '3.5' services: #Nginx Service - agent-landingpage-nginx: + report-se-web-nginx: image: nginx:alpine - container_name: agent-landingpage-nginx + container_name: report-se-web-nginx restart: unless-stopped tty: true ports: - - "19995:80" + - "19919:80" - "19915:443" volumes: - ./:/var/www @@ -15,9 +15,9 @@ services: networks: - app-network #Node Service - agent-landingpage-web: + report-se-web: image: node:16 - container_name: agent-landingpage-web + container_name: report-se-web build: context: . dockerfile: ./Dockerfile diff --git a/nginx/conf.d/vhost.conf b/nginx/conf.d/vhost.conf index 06cedb1..f5c0a8a 100644 --- a/nginx/conf.d/vhost.conf +++ b/nginx/conf.d/vhost.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name se_dev.sundayenglish.com; + server_name report.sundayenglish.com; index index.html; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log;