diff --git a/.gitignore b/.gitignore index c6bba59..b6febc3 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,6 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +# letsencrpyt certification +letsencrypt/ diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..182fa58 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,8 @@ +services: + nginx: + build: ./nginx + ports: + - 80:80 + - 443:443 + volumes: + - ./nginx/letsencrypt/:/etc/letsencrypt/ diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..4bbe406 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx:1.25.1-alpine3.17-slim + +RUN apk add certbot certbot-nginx + +RUN rm /etc/nginx/conf.d/default.conf + +COPY default.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 443 diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..83378f8 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,21 @@ +server { + listen 80; + listen [::]:80; + server_name test.tangoyankee.io; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}