Add dockerignore / update workflow
Some checks failed
Build And Publish / BuildAndPublish (push) Failing after 1m47s

This commit is contained in:
Ryan Freeman 2024-08-22 21:04:35 +01:00
parent 3115054522
commit 16db912909
2 changed files with 11 additions and 7 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
node_modules
.git
.env
.next

View File

@ -14,10 +14,10 @@ jobs:
with: with:
node-version: '18.17.0' node-version: '18.17.0'
- name: Installing dependencies # - name: Installing dependencies
run: npm ci --legacy-peer-deps # run: npm ci --legacy-peer-deps
env: # env:
NODE_OPTIONS: --max_old_space_size=4096 # NODE_OPTIONS: --max_old_space_size=4096
- name: Decrypt secrets - name: Decrypt secrets
run: ./decrypt_secrets.sh run: ./decrypt_secrets.sh
@ -43,7 +43,7 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: rfreeman420/portfolio:v1 tags: ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1
- name: Stop the docker container - name: Stop the docker container
continue-on-error: true continue-on-error: true
@ -54,7 +54,7 @@ jobs:
run: sudo docker rm portfolio run: sudo docker rm portfolio
- name: Pull the Docker image - name: Pull the Docker image
run: sudo docker pull rfreeman420/portfolio:v1 run: sudo docker pull ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1
- name: Run the Docker container - name: Run the Docker container
run: sudo docker run -d --restart unless-stopped --env-file ./.env --name portfolio -p ${{vars.TAILSCALE_IP}}:3000:3000 rfreeman420/portfolio:v1 run: sudo docker run -d --restart unless-stopped --env-file ./.env --name portfolio -p ${{vars.TAILSCALE_IP}}:3000:3000 ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1