From 6f03ba39efb7227475d39c1d3c194431a3448d80 Mon Sep 17 00:00:00 2001 From: nocode Date: Fri, 14 Jun 2024 21:59:43 +0700 Subject: [PATCH] first commit --- Dockerfile | 14 ++++ README.md | 0 docker-compose.yml | 50 ++++++++++++++ .../conf.d/student_conf.d/vhost_student.conf | 68 +++++++++++++++++++ .../conf.d/teacher_conf.d/vhost_teacher.conf | 68 +++++++++++++++++++ 5 files changed, 200 insertions(+) create mode 100755 Dockerfile create mode 100644 README.md create mode 100755 docker-compose.yml create mode 100755 nginx/conf.d/student_conf.d/vhost_student.conf create mode 100755 nginx/conf.d/teacher_conf.d/vhost_teacher.conf diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..36f8df5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:14 + +# Set working directory +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 + +#npm install +#RUN bash -c "cd /var/www/src; npm install" diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..71f8328 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,50 @@ +version: '3' +services: + #Nginx Service + student-register-nginx: + image: nginx:alpine + container_name: student-register-nginx + restart: unless-stopped + tty: true + ports: + - "1990:80" + - "19043:443" + volumes: + - ./:/var/www + - ./nginx/conf.d/student_conf.d/:/etc/nginx/conf.d + networks: + - app-network + teacher-register-nginx: + image: nginx:alpine + container_name: teacher-register-nginx + restart: unless-stopped + tty: true + ports: + - "1995:80" + - "19543:443" + volumes: + - ./:/var/www + - ./nginx/conf.d/teacher_conf.d:/etc/nginx/conf.d + networks: + - app-network + #node Service + node-register-web: + image: node:14 + container_name: node-register-web + build: + context: . + dockerfile: ./Dockerfile + restart: unless-stopped + tty: true + working_dir: /var/www + volumes: + - ./:/var/www + networks: + - app-network +#------------------------------------------------------------------------------- +#Docker Networks +networks: + app-network: + name: node_register_net + driver: bridge + # external: true diff --git a/nginx/conf.d/student_conf.d/vhost_student.conf b/nginx/conf.d/student_conf.d/vhost_student.conf new file mode 100755 index 0000000..772067d --- /dev/null +++ b/nginx/conf.d/student_conf.d/vhost_student.conf @@ -0,0 +1,68 @@ +server { + listen 80; + server_name se_dev.sundayenglish.com; + index index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /var/www/student/dang_ky_hoc_sinh/build; + + location / { + try_files $uri $uri/ /index.html$is_args$args; + gzip_static on; + } + + client_max_body_size 128m; +} +# server { +# listen 443 default_server ssl http2; +# listen [::]:443 ssl http2; +# server_name sundayenglish.com; +# index index.php index.html; +# error_log /var/log/nginx/error.log; +# access_log /var/log/nginx/access.log; +# root /var/www/main; +# add_header Access-Control-Allow-Origin *; +# ssl_certificate /etc/nginx/ssl/live/sundayenglish.com/fullchain.pem; +# ssl_certificate_key /etc/nginx/ssl/live/sundayenglish.com/privkey.pem; + +# location / { +# try_files $uri /index.html; +# } + +# location ~* \.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$ { +# expires 1h; +# add_header Cache-Control "public, no-transform"; +# gzip on; +# gzip_disable "msie6"; + +# gzip_vary on; +# gzip_proxied any; +# gzip_comp_level 6; +# gzip_buffers 16 8k; +# gzip_http_version 1.1; +# gzip_min_length 256; +# gzip_types +# application/atom+xml +# application/geo+json +# application/javascript +# application/x-javascript +# application/json +# application/ld+json +# application/manifest+json +# application/rdf+xml +# application/rss+xml +# application/xhtml+xml +# application/xml +# font/eot +# font/otf +# font/ttf +# image/svg+xml +# text/css +# text/javascript +# text/plain +# text/xml +# image/jpeg; +# } + +# client_max_body_size 1024m; +# } diff --git a/nginx/conf.d/teacher_conf.d/vhost_teacher.conf b/nginx/conf.d/teacher_conf.d/vhost_teacher.conf new file mode 100755 index 0000000..7b1b9b3 --- /dev/null +++ b/nginx/conf.d/teacher_conf.d/vhost_teacher.conf @@ -0,0 +1,68 @@ +server { + listen 80; + server_name se_dev.sundayenglish.com; + index index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /var/www/teacher/dang_ky_giao_vien/build; + + location / { + try_files $uri $uri/ /index.html$is_args$args; + gzip_static on; + } + + client_max_body_size 128m; +} +# server { +# listen 443 default_server ssl http2; +# listen [::]:443 ssl http2; +# server_name sundayenglish.com; +# index index.php index.html; +# error_log /var/log/nginx/error.log; +# access_log /var/log/nginx/access.log; +# root /var/www/main; +# add_header Access-Control-Allow-Origin *; +# ssl_certificate /etc/nginx/ssl/live/sundayenglish.com/fullchain.pem; +# ssl_certificate_key /etc/nginx/ssl/live/sundayenglish.com/privkey.pem; + +# location / { +# try_files $uri /index.html; +# } + +# location ~* \.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$ { +# expires 1h; +# add_header Cache-Control "public, no-transform"; +# gzip on; +# gzip_disable "msie6"; + +# gzip_vary on; +# gzip_proxied any; +# gzip_comp_level 6; +# gzip_buffers 16 8k; +# gzip_http_version 1.1; +# gzip_min_length 256; +# gzip_types +# application/atom+xml +# application/geo+json +# application/javascript +# application/x-javascript +# application/json +# application/ld+json +# application/manifest+json +# application/rdf+xml +# application/rss+xml +# application/xhtml+xml +# application/xml +# font/eot +# font/otf +# font/ttf +# image/svg+xml +# text/css +# text/javascript +# text/plain +# text/xml +# image/jpeg; +# } + +# client_max_body_size 1024m; +# }