Initial setup
This commit is contained in:
parent
9cbf31cd40
commit
99571b4d8d
2 changed files with 111 additions and 0 deletions
56
playbook.yml
Normal file
56
playbook.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
- hosts: localhost
|
||||
tasks:
|
||||
- name: create required directories
|
||||
become: true
|
||||
file:
|
||||
path: '{{ item.path }}'
|
||||
state: '{{ item.state }}'
|
||||
mode: '{{ item.mode }}'
|
||||
owner: '{{ item.owner }}'
|
||||
group: '{{ item.group }}'
|
||||
loop:
|
||||
- {
|
||||
path: '{{ app_dir }}',
|
||||
owner: sonny,
|
||||
group: sonny,
|
||||
state: directory,
|
||||
mode: 755
|
||||
}
|
||||
|
||||
- name: copy docker-compose file
|
||||
template:
|
||||
src: 'templates/docker-compose.j2'
|
||||
dest: '{{ app_dir }}/docker-compose.yml'
|
||||
|
||||
- name: stop glitchtip
|
||||
command: docker compose --file docker-compose.yml down
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
- name: pull {{ image_tag }}
|
||||
command: docker compose --file docker-compose.yml pull
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
- name: start glitchtip
|
||||
command: docker compose --file docker-compose.yml up --detach
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
vars:
|
||||
image_tag: 'glitchtip/glitchtip:v2'
|
||||
domain: 'glitchtip.fudiggity.nl'
|
||||
|
||||
app_dir: '/srv/docker/glitchtip'
|
||||
app_port: 7200
|
||||
|
||||
secret_key: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
66353662346631303938333161613564353336653038383664373232386261393362666361373133
|
||||
3964336431353532333665313266363761316331313638620a636631326334303663646339626632
|
||||
66313465653539306432623838646161623533393733306439333135383362666339373065643431
|
||||
3564343038633032390a346338663739333136343163386430303133386566336531313932323363
|
||||
33313837326432313661346136393533383262366162343564376437646366346166643939626461
|
||||
30316638373365306561383538646366636365396536323831343161613365613238643138336135
|
||||
39643832353735326631376234646261363230626339663366373133646536643937646431623866
|
||||
30316563323935326438
|
||||
55
templates/docker-compose.j2
Normal file
55
templates/docker-compose.j2
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
x-environment: &default-environment
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
|
||||
SECRET_KEY: '{{ secret_key }}'
|
||||
PORT: {{ app_port }}
|
||||
EMAIL_URL: consolemail://
|
||||
GLITCHTIP_DOMAIN: 'https://{{ domain }}'
|
||||
DEFAULT_FROM_EMAIL: email@example.com
|
||||
CELERY_WORKER_AUTOSCALE: "1,3"
|
||||
CSP_DEFAULT_SRC: "'self',{{ domain }}"
|
||||
CORS_ORIGIN_WHITELIST: https://{{ domain }}
|
||||
CSRF_TRUSTED_ORIGINS: https://{{ domain }}
|
||||
|
||||
x-depends_on: &default-depends_on
|
||||
- postgres
|
||||
- redis
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
environment:
|
||||
POSTGRES_HOST_AUTH_METHOD: 'trust'
|
||||
restart: always
|
||||
volumes:
|
||||
- pg-data:/var/lib/postgresql/data
|
||||
redis:
|
||||
image: valkey/valkey
|
||||
restart: always
|
||||
web:
|
||||
image: glitchtip/glitchtip
|
||||
depends_on: *default-depends_on
|
||||
ports:
|
||||
- '{{ app_port }}:{{ app_port }}'
|
||||
environment: *default-environment
|
||||
restart: always
|
||||
volumes:
|
||||
- uploads:/code/uploads
|
||||
worker:
|
||||
image: glitchtip/glitchtip
|
||||
command: ./bin/run-celery-with-beat.sh
|
||||
depends_on: *default-depends_on
|
||||
environment: *default-environment
|
||||
restart: always
|
||||
volumes:
|
||||
- uploads:/code/uploads
|
||||
migrate:
|
||||
image: glitchtip/glitchtip
|
||||
depends_on: *default-depends_on
|
||||
command: ./bin/run-migrate.sh
|
||||
environment: *default-environment
|
||||
|
||||
volumes:
|
||||
pg-data:
|
||||
uploads:
|
||||
Reference in a new issue