Add nginx_proxy_manager container
All checks were successful
Deploy / Deploy (push) Successful in 15s
All checks were successful
Deploy / Deploy (push) Successful in 15s
This commit is contained in:
33
.gitea/workflows/ci_cd.yml
Normal file
33
.gitea/workflows/ci_cd.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Setup ssh-agent
|
||||||
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Deploy to remote
|
||||||
|
env:
|
||||||
|
REMOTE_USER: ${{ vars.REMOTE_USER }}
|
||||||
|
REMOTE_HOST: ${{ vars.REMOTE_HOST }}
|
||||||
|
REMOTE_PATH: ${{ vars.REMOTE_PATH }}
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no "$REMOTE_USER"@"$REMOTE_HOST" "mkdir -p \"$REMOTE_PATH\""
|
||||||
|
scp -r ./* "$REMOTE_USER"@"$REMOTE_HOST":"$REMOTE_PATH"
|
||||||
|
ssh "$REMOTE_USER"@"$REMOTE_HOST" "docker compose -f $REMOTE_PATH/compose.yml down"
|
||||||
|
ssh "$REMOTE_USER"@"$REMOTE_HOST" "docker compose -f $REMOTE_PATH/compose.yml pull"
|
||||||
|
ssh "$REMOTE_USER"@"$REMOTE_HOST" "docker compose -f $REMOTE_PATH/compose.yml up -d --force-recreate"
|
||||||
|
|
||||||
39
compose.yml
Normal file
39
compose.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
services:
|
||||||
|
nginx_proxy_manager:
|
||||||
|
image: jlesage/nginx-proxy-manager:v25.09.1
|
||||||
|
user: 2021:2021 # nginx_proxy_manager:nginx_proxy_manager
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
restart: true
|
||||||
|
networks:
|
||||||
|
- nginx_proxy_manager_network
|
||||||
|
ports:
|
||||||
|
- 80:80 # Public HTTP Port
|
||||||
|
- 443:443 # Public HTTPS Port
|
||||||
|
- 8181:8181 # Admin Web UI
|
||||||
|
- 8448:8448 # Matrix Federation Port
|
||||||
|
volumes:
|
||||||
|
- config:/config:rw
|
||||||
|
|
||||||
|
init:
|
||||||
|
image: busybox:1.37.0
|
||||||
|
user: root:root
|
||||||
|
command: /init.sh
|
||||||
|
restart: no
|
||||||
|
network_mode: none
|
||||||
|
volumes:
|
||||||
|
- ./init.sh:/init.sh:ro
|
||||||
|
# Used for resolving user and group names within the init script
|
||||||
|
- /etc/passwd:/etc/passwd:ro
|
||||||
|
- /etc/group:/etc/group:ro
|
||||||
|
# Mount all named volumes so they can be initialised
|
||||||
|
- config:/config:rw
|
||||||
|
|
||||||
|
networks:
|
||||||
|
nginx_proxy_manager_network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
config:
|
||||||
16
init.sh
Executable file
16
init.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Define a helper function that runs a command
|
||||||
|
# If the command fails, the script prints an error message
|
||||||
|
# and exits immediately.
|
||||||
|
run() {
|
||||||
|
# "$@" expands to all arguments passed to this function
|
||||||
|
# and preserves proper word splitting and quoting.
|
||||||
|
"$@" || {
|
||||||
|
echo "Error: command failed: $*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
run chown nginx_proxy_manager:nginx_proxy_manager /config
|
||||||
|
|
||||||
Reference in New Issue
Block a user