as you see i’m already wrote COPY package*.json /usr/app/
when i’m try to run docker-compose run bona_api ls
it only returns node_modules
Dockerfile:
FROM node:16.3.0-alpine
WORKDIR /usr/app
COPY package*.json /usr/app/
COPY ecosystem.config.js .
# COPY run.sh /
RUN npm i
RUN npm install -g pg
RUN npm install -g typescript@latest
RUN npm install -g nodemon
RUN npm install pm2 -g
COPY . .
EXPOSE 3000
ARG STAGE
ARG START_SCRIPT
RUN echo "will srart on stage ${STAGE}"
RUN chmod -R 777 /root
CMD ["sh", "-c", "npm run ${START_SCRIPT}"]
config.yml:
version: 2
orbs:
shellcheck: circleci/shellcheck@x.y.z
jobs:
build:
working_directory: /backend
docker:
- image: docker:17.05.0-ce-git
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule sync
git submodule update --init
- restore_cache:
key: v1-deps-{{ checksum "package-lock.json" }}
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Install dependencies
command: |
apk add --no-cache py-pip=9.0.0-r1
pip install docker-compose==1.15.0
cp .example.env .env
- save_cache:
key: v1-deps-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run:
name: start service
command: |
cp .example.env .env
apk update && apk add curl curl-dev bash
docker network create bona-invest_default || true
docker-compose up --build --remove-orphans
- run:
name: run tests
command: |
chmod 777 ./tests_start.sh
./tests_start.sh
- store_artifacts:
path: test-reports/
destination: bona-backend