diff --git a/apps/frontend/.dockerignore b/apps/frontend/.dockerignore new file mode 100644 index 0000000..76add87 --- /dev/null +++ b/apps/frontend/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/apps/frontend/Dockerfile b/apps/frontend/Dockerfile new file mode 100644 index 0000000..aed5e02 --- /dev/null +++ b/apps/frontend/Dockerfile @@ -0,0 +1,23 @@ +FROM node:20-alpine3.19 AS build + +WORKDIR /app + +COPY package.json ./ + +COPY yarn.lock ./ + +RUN yarn install + +COPY . ./ + +RUN yarn build + +FROM nginx:stable-alpine + +COPY --from=build /app/dist /usr/share/nginx/html + +COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 3000 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/frontend/nginx/nginx.conf b/apps/frontend/nginx/nginx.conf new file mode 100644 index 0000000..b6a6d3a --- /dev/null +++ b/apps/frontend/nginx/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 3000; + location / { + root /usr/share/nginx/html/; + include /etc/nginx/mime.types; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file