Skip to content

Commit

Permalink
add Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ifdjhxh committed Dec 12, 2024
1 parent 9a11265 commit a141df2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM mongodb/mongodb-community-server:6.0-ubi8
WORKDIR /
COPY . .
CMD ["mongod", "--port", "27017"]
27 changes: 27 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
11 changes: 11 additions & 0 deletions main/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:22.12.0

COPY package*.json ./

Check failure on line 3 in main/Dockerfile

View workflow job for this annotation

GitHub Actions / Проверка наличия тега 0.8 и работоспособности docker-compose

DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.

RUN npm install

COPY . .

Check failure on line 7 in main/Dockerfile

View workflow job for this annotation

GitHub Actions / Проверка наличия тега 0.8 и работоспособности docker-compose

DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.

EXPOSE 4444

CMD ["node", "index.js"]

0 comments on commit a141df2

Please sign in to comment.