I am new to Docker and buidling a docker-compose file to setup my nodejs dev environment from a single file. Idea is to give a docker-compose file to a developer from where they can simply spin up the containers and start development.
When I docker-compose up, the application is built and runs with success. But my problem is when I open it in dev containers in Vscode, it fails to recognize as a git repo.
.dockerignore
node_modules
npm-debug.log
Dockerfile
FROM node:16.15.0 as develop-stage
WORKDIR /code
COPY package.json .
# Using package-lock file to fix the version of installed modules.
COPY package-lock.json .
RUN npm install
COPY . .
EXPOSE 9608
CMD ['nodemon' 'index.js']
Docker-compose
version: '3.8'
services:
my-service:
container_name: my-service
build:
context: 'https://username:[email protected]/abc/test-repo'
dockerfile: Dockerfile
volumes:
- my-data:/code
command: nodemon index.js
networks:
- my-network
expose:
- 9608
ports:
- 9608:9608
restart: on-failure
volumes:
my-data:
external: false
networks:
my-network:
external: false
ls -ainside the container on the root folder do you see a.gitfolder?.dockerignorefile, and if so what does it contain?COPY .git/ ./.git/?