강동현

웹서버 설정에 인증서 추가 및 https 포트 개방

...@@ -15,4 +15,6 @@ services: ...@@ -15,4 +15,6 @@ services:
15 dockerfile: ./web/Dockerfile 15 dockerfile: ./web/Dockerfile
16 restart: unless-stopped 16 restart: unless-stopped
17 ports: 17 ports:
18 - - "80:80" 18 + - "443:443"
19 + volumes:
20 + - /etc/letsencrypt:/etc/letsencrypt
......
...@@ -19,6 +19,6 @@ FROM nginx:latest ...@@ -19,6 +19,6 @@ FROM nginx:latest
19 COPY web/default.conf /etc/nginx/conf.d/default.conf 19 COPY web/default.conf /etc/nginx/conf.d/default.conf
20 COPY --from=build /usr/web/build /usr/web/build 20 COPY --from=build /usr/web/build /usr/web/build
21 21
22 -EXPOSE 80 22 +EXPOSE 443
23 23
24 -CMD ["nginx", "-g", "daemon off;"]
...\ No newline at end of file ...\ No newline at end of file
24 +CMD ["nginx", "-g", "daemon off;"]
......
1 server { 1 server {
2 - listen 80; 2 + listen 443 ssl default_server;
3 + server_name 2020105578.oss2021.tk;
4 +
5 + ssl_certificate /etc/letsencrypt/live/2020105578.oss2021.tk/fullchain.pem;
6 + ssl_certificate_key /etc/letsencrypt/live/2020105578.oss2021.tk/privkey.pem;
7 +
3 location / { 8 location / {
4 root /usr/web/build; 9 root /usr/web/build;
5 index index.html; 10 index index.html;
6 try_files $uri $uri/ /index.html; 11 try_files $uri $uri/ /index.html;
7 } 12 }
8 -}
...\ No newline at end of file ...\ No newline at end of file
13 +}
......