Compare commits

...

12 Commits

Author SHA1 Message Date
45f2c61c17 Merge pull request 'docker swarm' (#14) from feat/add-docker into main
All checks were successful
Build, Test & Publish / Build (push) Successful in 23s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 1m13s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 2m25s
Reviewed-on: #14
2025-10-22 13:13:33 +11:00
dd30ade94b docker swarm
All checks were successful
Build, Test & Publish / Build (pull_request) Successful in 26s
Build, Test & Publish / Build and Publish Container Image (pull_request) Has been skipped
Build, Test & Publish / Deploy to Infrastructure (pull_request) Has been skipped
2025-10-22 13:11:59 +11:00
587287fb82 Merge pull request 'update commands for postgres' (#13) from fix/postgres into main
All checks were successful
Build, Test & Publish / Build (push) Successful in 27s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 29s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 1m8s
Reviewed-on: #13
2025-10-20 12:23:57 +11:00
78788f05e3 Merge branch 'main' into fix/postgres
All checks were successful
Build, Test & Publish / Build (pull_request) Successful in 27s
Build, Test & Publish / Build and Publish Container Image (pull_request) Has been skipped
Build, Test & Publish / Deploy to Infrastructure (pull_request) Has been skipped
2025-10-20 12:23:45 +11:00
87d81bb447 revert so can deploy
All checks were successful
Build, Test & Publish / Build (push) Successful in 31s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 1m13s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 1m9s
2025-10-20 12:20:05 +11:00
52427c453e change to use var
Some checks failed
Build, Test & Publish / Build (push) Successful in 24s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 30s
Build, Test & Publish / Deploy to Infrastructure (push) Failing after 8m59s
2025-10-19 21:47:12 +11:00
6e5d4e39e7 try fix job nomad
Some checks failed
Build, Test & Publish / Build (push) Successful in 24s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 29s
Build, Test & Publish / Deploy to Infrastructure (push) Failing after 11s
2025-10-19 21:43:39 +11:00
ea1bc210c6 Merge pull request 'fix var' (#12) from feat/new-infra into main
Some checks failed
Build, Test & Publish / Build (push) Successful in 25s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 30s
Build, Test & Publish / Deploy to Infrastructure (push) Failing after 11s
Reviewed-on: #12
2025-10-19 21:40:24 +11:00
acee9670d0 fix var
All checks were successful
Build, Test & Publish / Build (pull_request) Successful in 23s
Build, Test & Publish / Build and Publish Container Image (pull_request) Has been skipped
Build, Test & Publish / Deploy to Infrastructure (pull_request) Has been skipped
2025-10-19 21:39:32 +11:00
c2cf7bc905 Merge pull request 'added noamad deployment' (#11) from feat/new-infra into main
Some checks failed
Build, Test & Publish / Build (push) Successful in 7m57s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 30s
Build, Test & Publish / Deploy to Infrastructure (push) Failing after 13s
Reviewed-on: #11
2025-10-19 21:27:55 +11:00
aca87e3db1 added noamad deployment
Some checks failed
Build, Test & Publish / Build and Publish Container Image (pull_request) Has been cancelled
Build, Test & Publish / Deploy to Infrastructure (pull_request) Has been cancelled
Build, Test & Publish / Build (pull_request) Has been cancelled
2025-10-19 21:26:43 +11:00
afee68fa90 Merge pull request 'fix' (#10) from fix/postgres into main
All checks were successful
Build, Test & Publish / Build (push) Successful in 25s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 32s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 2m31s
Reviewed-on: #10
2025-10-15 16:14:30 +11:00
5 changed files with 95 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ jobs:
images: liamsgit.dev/LiamPietralla/code-snippets
tags: |
type=raw,value=latest
type=sha,value=${{ github.sha }}
- name: Login to Registry
uses: docker/login-action@v3
@@ -98,5 +99,16 @@ jobs:
ansible-playbook infra/ansible/deploy-playbook.yml --private-key private.key --inventory hosts.ini
env:
APP_HOST: ${{ secrets.APP_HOST }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REGISTRY_USERNAME: ${{ secrets.DOCKER_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# - name: Setup Nomad
# uses: hashicorp/setup-nomad@main
# with:
# nomad_version: '1.10.5'
# - name: Deploy Job to Nomad
# run: |
# nomad job run -var="version=${{ github.sha }}" infra/nomad/code-snippets.nomad.hcl
# env:
# NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}

View File

@@ -76,6 +76,10 @@ export default defineConfig({
{ text: 'Local DB (PostgreSQL)', link: '/docker/local-db-pg' },
]
},
{
text: 'Docker Swarm',
link: '/docker-swarm/',
},
{
text: 'EF Core',
link: '/ef-core/',

View File

@@ -0,0 +1,27 @@
# Docker Swarm Snippets and Musings
## Updating Services
View services:
```bash
docker service ls
```
To scale a service up or down:
```bash
docker service scale <service_name>=<number_of_replicas>
```
Sometimes services get stuck or need to be forcefully updated:
```bash
docker service update --force <service_name>
```
::: tip
Sometimes if you need to force containers to restart use the update force (e.g. after restarting a node).
:::

View File

@@ -26,6 +26,10 @@ hero:
text: Docker
link: /docker/
- theme: alt
text: Docker Swarm
link: /docker-swarm/
- theme: alt
text: EF Core
link: /ef-core/

View File

@@ -0,0 +1,46 @@
variable "version" {
type = string
default = "latest"
}
job "code-snippets" {
datacenters = ["dc1"]
type = "service"
group "code-snippets" {
count = 1
network {
port "http" {
to = 80
}
}
task "code-snippets" {
driver = "docker"
config {
image = "liamsgit.dev/LiamPietralla/code-snippets:${var.version}"
force_pull = true
ports = ["http"]
}
service {
name = "code-snippets"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.code-snippets.rule=PathPrefix(`/`)",
"traefik.http.routers.code-snippets.entrypoints=p5003"
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}
}