Hi,
I did a basic docker setup with node and mongo. But running
docker compose up
Takes many minutes. This is probably a mistake I guess?
Any ideas what could cause something like this?
This is my Dockerfile
FROM node:alpine
WORKDIR /usr/src/app
COPY package*.json .
COPY . .
RUN npm ci
RUN npm run build
CMD ["npm", "start"]
and this is my docker-compose.yml
version: "3.9"
services:
# mongo db
mongo_db:
container_name: db_gag_container
image: mongo:latest
restart: always
volumes:
- mongo_db:/data/db
# api gags
api:
build: .
ports:
- "3000:3000"
environment:
PORT: 3000
MONGODB_URI: mongodb://mongo_db:27017
DB_NAME: gag
NAME: gag
depends_on:
- mongo_db
volumes:
mongo_db: {}
I have a .dockerignore aswell which looks like this:
node_modules
./node_modules
Dockerfile
.dockerignore
docker-compose.yml
This currently output after running docker compose up in the terminal is this
[+] Building 525.5s (2/3)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 31B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/node:alpine 525.3s