diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4938407..5485621 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,14 +14,25 @@ jobs: steps: - uses: actions/checkout@v2 - + ### configura o ambiente de execução para Node.js - name: Set up Node.js uses: actions/setup-node@v1 with: node-version: "20.x" - + ### instala as dependências do projeto na máquina virtual - name: Install dependencies run: npm install - + ### executa os testes do projeto - name: Run tests run: npm test + security: + runs-on: ubuntu-latest + needs: build + name: Run the SCA scan on the source code + steps: + - uses: actions/checkout@v2 + - name: Run the SCA scan on the source code + uses: snyk/actions/node@master + continue-on-error: true + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb3a565 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18.3.0-alpine3.15 + +WORKDIR /app + +COPY package*json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6612888 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + app: + build: . + ports: + - "3000:3000" + volumes: + - .:/app + environment: + - NODE_ENV=development + command: npm start \ No newline at end of file