diff --git a/backend/dockerfile b/backend/dockerfile new file mode 100644 index 0000000..6e3d6ab --- /dev/null +++ b/backend/dockerfile @@ -0,0 +1,14 @@ +# backend/Dockerfile +FROM node:18 + +WORKDIR /app + +COPY package.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ce4f75f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +services: + backend: + build: + context: ./backend + ports: + - "3000:3000" + environment: + - NODE_ENV=production + volumes: + - ./backend:/app + depends_on: + - frontend + + frontend: + build: + context: ./frontend + ports: + - "80:80" + environment: + - NODE_ENV=production + volumes: + - ./frontend:/app diff --git a/frontend/dockerfile b/frontend/dockerfile new file mode 100644 index 0000000..b591814 --- /dev/null +++ b/frontend/dockerfile @@ -0,0 +1,20 @@ +# frontend/Dockerfile +FROM node:18 AS build + +WORKDIR /app + +COPY package.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +FROM nginx:stable-alpine AS production + +COPY --from=build /app/dist /usr/share/nginx/html + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"]