Update website deployment to unify containers
All checks were successful
/ terraform (push) Successful in 1m9s
/ ansible (push) Successful in 2m17s

This commit is contained in:
Jake Howard 2024-01-14 14:22:19 +00:00
parent ac166c3874
commit 9d685d85aa
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 24 additions and 49 deletions

View File

@ -1,58 +1,33 @@
version: "2.3"
x-website: &website
image: registry.gitlab.com/realorangeone/website:latest
user: "{{ docker_user.id }}"
restart: unless-stopped
init: true
environment:
- TZ={{ timezone }}
- DEBUG=false
- SECRET_KEY={{ vault_website_secret_key }}
- DATABASE_URL=postgres://website:website@db/website?conn_max_age=600
- CACHE_URL=redis://redis/0
- QUEUE_STORE_URL=redis://redis/1
- RENDITION_CACHE_URL=redis://redis/2
- SPOTIFY_PROXY_URL=http://spotify_public_proxy
- UNSPLASH_CLIENT_ID={{ vault_unsplash_client_id }}
- SENTRY_DSN={{ vault_website_sentry_dsn }}
- BASE_HOSTNAME=theorangeone.net
- WEB_CONCURRENCY=3
- SEO_INDEX=true
- ACTIVITYPUB_HOST=mastodon.theorangeone.net
volumes:
- ./media:/app/media
tmpfs:
- /tmp
services:
nginx:
<<: *website
user: root
command: /app/etc/entrypoints/nginx
website:
image: registry.gitlab.com/realorangeone/website:latest
restart: unless-stopped
environment:
- TZ={{ timezone }}
- DEBUG=false
- SECRET_KEY={{ vault_website_secret_key }}
- DATABASE_URL=postgres://website:website@db/website?conn_max_age=600
- CACHE_URL=redis://redis/0
- QUEUE_STORE_URL=redis://redis/1
- RENDITION_CACHE_URL=redis://redis/2
- SPOTIFY_PROXY_URL=http://spotify_public_proxy
- UNSPLASH_CLIENT_ID={{ vault_unsplash_client_id }}
- SENTRY_DSN={{ vault_website_sentry_dsn }}
- BASE_HOSTNAME=theorangeone.net
- WEB_CONCURRENCY=3
- SEO_INDEX=true
- ACTIVITYPUB_HOST=mastodon.theorangeone.net
volumes:
- ./media:/app/media
- ./cache:/tmp/nginx_cache
tmpfs:
- /tmp
networks:
- default
- coredns
depends_on:
- django
worker:
<<: *website
command: /app/etc/entrypoints/worker
depends_on:
- db
- redis
cron:
<<: *website
command: /app/etc/entrypoints/cron
depends_on:
- db
- redis
django:
<<: *website
command: /app/etc/entrypoints/web
depends_on:
- db
- redis

View File

@ -28,7 +28,7 @@
become: true
vars:
server_name: theorangeone.net
upstream: website-nginx-1.docker:8000
upstream: website-website-1.docker:8000
ssl_cert_path: /etc/letsencrypt/live/theorangeone.net
location_extra: |
more_set_headers "Server: $upstream_http_server";