Skip to content

Commit

Permalink
Add Docker configuration files and update Node.js version in main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceloBxD committed Apr 23, 2024
1 parent 500bcda commit 98cbeb2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'

services:
app:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
environment:
- NODE_ENV=development
command: npm start

0 comments on commit 98cbeb2

Please sign in to comment.