update infra for new setup
All checks were successful
Build, Test & Publish / Build (push) Successful in 29s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 2m31s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 38s

This commit is contained in:
2025-11-12 13:57:44 +11:00
parent 45f2c61c17
commit 10e2eaa16b
5 changed files with 28 additions and 95 deletions

View File

@@ -1,11 +0,0 @@
---
- name: Configure App Server
hosts: app
remote_user: root
become: yes # sudo
roles:
- app
vars:
registry_username: "{{ lookup('env', 'REGISTRY_USERNAME') }}"
registry_password: "{{ lookup('env', 'REGISTRY_PASSWORD') }}"

View File

@@ -1,13 +0,0 @@
server {
listen 80;
server_name code.liampietralla.com;
location / {
proxy_pass http://localhost:5000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}

View File

@@ -1,31 +0,0 @@
- name: Login to Docker Registry
docker_login:
registry: liamsgit.dev
username: "{{ registry_username }}"
password: "{{ registry_password }}"
- name: Run Code App Container
docker_container:
name: code
image: liamsgit.dev/liampietralla/code-snippets
pull: yes
ports:
- "5000:80"
restart_policy: unless-stopped
- name: Copy nginx config file
copy:
src: nginx.conf
dest: /etc/nginx/sites-available/code
force: no
- name: Create symlink to code
file:
src: /etc/nginx/sites-available/code
dest: /etc/nginx/sites-enabled/code
state: link
- name: Restart Nginx
service:
name: nginx
state: restarted