Skip to content

Commit

Permalink
feat: enhance CI/CD workflow and update Docker configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoMeireles55 committed Jan 17, 2025
1 parent 05dda8a commit 87c7564
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 47 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker-image-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Docker Image CI/CD

on:
push:
Expand All @@ -25,5 +25,10 @@ jobs:
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
- name: Build and push Docker image
run: |
docker-compose build
docker-compose push
docker-compose -f docker-compose.build.yml build
docker-compose -f docker-compose.build.yml push
- name: Deploy to server
run: |
docker-compose pull
docker-compose up -d
EOF
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ COPY --from=builder /app/public /app/public

# Instale apenas dependências de produção
RUN npm ci --omit=dev
RUN npm prune --production

EXPOSE 3000

CMD ["npm", "start"]
RUN npm prune --production
36 changes: 18 additions & 18 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
services:
quality-lab-pro-front-end:
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
environment:
- NODE_ENV=production
volumes:
- qualitylab_node_modules:/app/node_modules
- qualitylab_public:/app/public
stdin_open: true
tty: true
command: ['npm', 'start']
networks:
- qualitylab-net
quality-lab-pro-front-end:
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
environment:
- NODE_ENV=production
volumes:
- qualitylab_node_modules:/app/node_modules
- qualitylab_public:/app/public
stdin_open: true
tty: true
command: ['npm', 'start']
networks:
- qualitylab-net

volumes:
qualitylab_node_modules:
qualitylab_public:
qualitylab_node_modules:
qualitylab_public:

networks:
- app-network
6 changes: 6 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
quality-lab-pro-front-end:
build:
context: .
dockerfile: Dockerfile
image: leonardomeireles55/quality-lab-pro-front-end:latest
39 changes: 18 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
services:
quality-lab-pro-front-end:
image: leonardomeireles55/quality-lab-pro-front-end:latest
build:
context: .
dockerfile: Dockerfile
ports:
- '3000'
environment:
- NODE_ENV=production
volumes:
# - qualitylab_node_modules:/app/node_modules
- qualitylab_public:/app/public
stdin_open: true
tty: true
command: ['npm', 'start']
networks:
- qualitylab-net
quality-lab-pro-front-end:
image: leonardomeireles55/quality-lab-pro-front-end:latest
ports:
- '3000'
environment:
- NODE_ENV=production
volumes:
# - qualitylab_node_modules:/app/node_modules
- qualitylab_public:/app/public
stdin_open: true
tty: true
command: ['npm', 'start']
networks:
- qualitylab-net

volumes:
qualitylab_node_modules:
qualitylab_public:
qualitylab_node_modules:
qualitylab_public:

networks:
qualitylab-net:
external: true
qualitylab-net:
external: true

0 comments on commit 87c7564

Please sign in to comment.