diff --git a/db/Dockerfile b/db/Dockerfile new file mode 100644 index 0000000..648f073 --- /dev/null +++ b/db/Dockerfile @@ -0,0 +1,4 @@ +FROM mongodb/mongodb-community-server:6.0-ubi8 +WORKDIR / +COPY . . +CMD ["mongod", "--port", "27017"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..274a19a --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,27 @@ +version: "3.8" + +services: + app: + container_name: app + build: + context: ./main + dockerfile: Dockerfile + depends_on: + - db + ports: + - "127.0.0.1:4444:4444" + + db: + container_name: db + build: + context: ./db + dockerfile: Dockerfile + restart: unless-stopped + env_file: + - .env + volumes: + - mongo-data:/data/db + + +volumes: + mongo-data: diff --git a/main/Dockerfile b/main/Dockerfile new file mode 100644 index 0000000..1f5f8fe --- /dev/null +++ b/main/Dockerfile @@ -0,0 +1,11 @@ +FROM node:22.12.0 + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 4444 + +CMD ["node", "index.js"] \ No newline at end of file