Skip to content

Commit

Permalink
feat: ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
plh97 committed Oct 29, 2023
1 parent b66f1f9 commit d819940
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
36 changes: 18 additions & 18 deletions ansible/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
force: true
version: develop

- name: copy cert key file
copy:
src: /etc/letsencrypt/live/plhh.link/privkey.pem
dest: ~/chatroom/nginx/cert/privkey.pem
remote_src: yes
- name: copy cert key file
copy:
src: /etc/letsencrypt/live/plhh.link/fullchain.pem
dest: ~/chatroom/nginx/cert/fullchain.pem
remote_src: yes
# - name: copy cert key file
# copy:
# src: /etc/letsencrypt/live/plhh.link/privkey.pem
# dest: ~/chatroom/nginx/cert/privkey.pem
# remote_src: yes
# - name: copy cert key file
# copy:
# src: /etc/letsencrypt/live/plhh.link/fullchain.pem
# dest: ~/chatroom/nginx/cert/fullchain.pem
# remote_src: yes

- name: install dependences
command:
cmd: yarn run bootstrap
chdir: ~/chatroom
# - name: install dependences
# command:
# cmd: yarn run bootstrap
# chdir: ~/chatroom

- name: build
command:
chdir: ~/chatroom
cmd: npm run build
# - name: build
# command:
# chdir: ~/chatroom
# cmd: npm run build

- name: deploy
command:
Expand Down
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ services:
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/log:/var/log/nginx/
ports:
- "443:443"
- "443:443/udp"
- "8443:8443"
- "8080:8080"
# - "443:443"
# - "443:443/udp"
# - "8443:8443"

networks:
- gate-tier

Expand All @@ -31,11 +33,13 @@ services:

backend:
restart: always
# ports:
# - "8080:8080"
command: "yarn run deploy"
environment:
MONGODB_IP: mongodb
PORT: "8080"
FRONTEND_PORT: "80"
# FRONTEND_PORT: "80"
build:
context: "./packages/backend"
volumes:
Expand Down
13 changes: 7 additions & 6 deletions nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# return 301 https://$host$request_uri;
# }

log_format quic '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http3"';
access_log /var/log/nginx/access.log quic;
# log_format quic '$remote_addr - $remote_user [$time_local] '
# '"$request" $status $body_bytes_sent '
# '"$http_referer" "$http_user_agent" "$http3"';
# access_log /var/log/nginx/access.log quic;

server {
# gzip
Expand All @@ -25,8 +25,9 @@ server {
server_name localhost;


listen 443 quic reuseport;
listen 443 ssl http2;
# listen 443 quic reuseport;
# listen 443 ssl http2;
listen 8080 default_server;
proxy_set_header Host $host;

# location / {
Expand Down

0 comments on commit d819940

Please sign in to comment.