diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..388d824 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +services: + notes-app: + build: ./notes-app/ + restart: always + notes-back: + build: ./notes-backend/ + restart: always + nginx: + image: nginx:1.25.3-alpine-slim + volumes: + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf + ports: + - "80:80" + restart: always + depends_on: + - notes-app + - notes-back diff --git a/notes-app/Dockerfile b/notes-app/Dockerfile new file mode 100644 index 0000000..4ef08c1 --- /dev/null +++ b/notes-app/Dockerfile @@ -0,0 +1,8 @@ +FROM node:18-slim AS first_stage +WORKDIR /usr/local/app +COPY package.json package-lock.json ./ +RUN npm i && npm cache clean --force +COPY . . +RUN npm run build -- --prod +CMD ["npx","serve","-s","build"] + diff --git a/notes-backend/Dockerfile b/notes-backend/Dockerfile new file mode 100644 index 0000000..e53d885 --- /dev/null +++ b/notes-backend/Dockerfile @@ -0,0 +1,6 @@ + FROM node:18-slim + WORKDIR /usr/local/app + COPY package*.json ./ + RUN npm i && npm cache clean --force + COPY . . + CMD ["npm","start"]