Skip to content

Commit

Permalink
Update docker compose prod
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekiwaniuk committed Nov 9, 2024
1 parent 90d3faf commit e41468d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 30 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ jobs:
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/deployments/portfolio
docker compose pull
docker compose down
docker compose up -d
cd ~/apps/portfolio
git pull
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml down
docker compose -f docker-compose.prod.yml up -d
31 changes: 31 additions & 0 deletions docker-compose.old.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
nginx:
container_name: portfolio-nginx
depends_on:
- frontend
image: nginx:1.27.2-alpine
ports:
- 80:80
restart: unless-stopped
volumes:
- ./docker/nginx/prod/nginx.conf:/etc/nginx/nginx.conf
networks:
- portfolio-network

frontend:
container_name: portfolio-frontend
image: node:23-alpine
environment:
- HOST=0.0.0.0
- PORT=3000
command: sh -c "npm install && npx nuxi build && node .output/server/index.mjs"
restart: on-failure
volumes:
- .:/var/www/html
working_dir: /var/www/html
networks:
- portfolio-network

networks:
portfolio-network:
driver: bridge
32 changes: 6 additions & 26 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
services:
frontend:
image: maciekiwaniuk/portfolio-frontend:latest

nginx:
container_name: portfolio-nginx
depends_on:
- frontend
image: nginx:1.27.2-alpine
image: maciekiwaniuk/portfolio-nginx:latest
ports:
- 80:80
restart: unless-stopped
volumes:
- ./docker/nginx/prod/nginx.conf:/etc/nginx/nginx.conf
networks:
- portfolio-network

frontend:
container_name: portfolio-frontend
image: node:23-alpine
environment:
- HOST=0.0.0.0
- PORT=3000
command: sh -c "npm install && npx nuxi build && node .output/server/index.mjs"
restart: on-failure
volumes:
- .:/var/www/html
working_dir: /var/www/html
networks:
- portfolio-network

networks:
portfolio-network:
driver: bridge
depends_on:
- frontend

0 comments on commit e41468d

Please sign in to comment.