From 8f2d6b161388f40c4d13377fb867aec5d2598e7a Mon Sep 17 00:00:00 2001 From: agatha Date: Sat, 6 Apr 2024 17:50:21 -0400 Subject: [PATCH] add Dockerfile and nginx configuration --- frontend/Dockerfile | 8 ++++++++ frontend/conf/nginx.conf | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 frontend/Dockerfile create mode 100644 frontend/conf/nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..69be12b --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,8 @@ +FROM nginx:stable-alpine + +COPY ./conf/nginx.conf /etc/nginx/nginx.conf + +WORKDIR /app +COPY ./src/. . + +EXPOSE 8000 \ No newline at end of file diff --git a/frontend/conf/nginx.conf b/frontend/conf/nginx.conf new file mode 100644 index 0000000..6fb2c95 --- /dev/null +++ b/frontend/conf/nginx.conf @@ -0,0 +1,22 @@ +events { + worker_connections 1024; +} + +http { + server { + listen 8000 default_server; + listen [::]:8000 default_server; + + root /app; + index index.html; + server_name _; + + location / { + try_files $uri $uri/ =404; + } + + location /api/ { + proxy_pass http://backend:8000/; + } + } +} \ No newline at end of file