mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 04:09:25 +08:00
Update .env values and set up woodpecker.yml
This commit is contained in:
parent
d8065bc70a
commit
67a20a3330
5 changed files with 41 additions and 6 deletions
|
@ -2,4 +2,5 @@ firefox/
|
||||||
chrome/
|
chrome/
|
||||||
dumps/
|
dumps/
|
||||||
media/
|
media/
|
||||||
TODO.md
|
TODO.md
|
||||||
|
.env
|
|
@ -46,8 +46,10 @@ STRIPE_SECRET_WEBHOOK = ''
|
||||||
|
|
||||||
USE_VAULT = 'False'
|
USE_VAULT = 'False'
|
||||||
SERVE_MEDIA = 'False'
|
SERVE_MEDIA = 'False'
|
||||||
BACKEND_URL = 'localhost:8000'
|
BACKEND_ADDRESS = 'localhost'
|
||||||
FRONTEND_URL = 'localhost:4200'
|
BACKEND_PORT = 8000
|
||||||
|
FRONTEND_ADDRESS = 'localhost'
|
||||||
|
FRONTEND_PORT = 4200
|
||||||
USE_HTTPS = 'False'
|
USE_HTTPS = 'False'
|
||||||
TIMEZONE = 'Asia/Manila'
|
TIMEZONE = 'Asia/Manila'
|
||||||
|
|
||||||
|
|
30
.woodpecker.yml
Normal file
30
.woodpecker.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# .woodpecker.yml
|
||||||
|
steps:
|
||||||
|
- name: build & push
|
||||||
|
image: alpine:3.20.2
|
||||||
|
when:
|
||||||
|
- branch: master
|
||||||
|
- event: push
|
||||||
|
commands:
|
||||||
|
- apt update && apt install -y docker docker-buildx-plugin
|
||||||
|
- docker buildx build . -t git.keannu1.duckdns.org/keannu125/drf_template
|
||||||
|
- cat "$GITEA_PASSWORD" | docker login git.keannu1.duckdns.org --username "$GITEA_USERNAME" --pasword-stdin
|
||||||
|
- docker push git.keannu1.duckdns.org/keannu125/drf_template
|
||||||
|
- name: update deployment and reset database
|
||||||
|
image: alpine:3.20.2
|
||||||
|
when:
|
||||||
|
- branch: master
|
||||||
|
- event: push
|
||||||
|
commands:
|
||||||
|
- mkdir -p /root/.ssh/
|
||||||
|
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
||||||
|
- chmod 600 /root/.ssh/id_rsa
|
||||||
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
||||||
|
- ssh root@10.0.10.4 '
|
||||||
|
cd /mnt/nvme/files/docker projects/EquipmentTracker-Backend;
|
||||||
|
docker-compose down;
|
||||||
|
docker image rm git.keannu1.duckdns.org/keannu125/drf_template;
|
||||||
|
docker volume rm git.keannu1.duckdns.org/keannu125/drf_template_db_data;
|
||||||
|
docker compose up -d'
|
||||||
|
- scp -r dist/* root@10.0.10.4:/mnt/nvme/www/equipment_tracker_frontend
|
||||||
|
secrets: [SSH_KEY, REGISTRY_USERNAME, REGISTRY_PASSWORD]
|
|
@ -37,8 +37,10 @@ def get_secret(secret_name):
|
||||||
# URL Prefixes
|
# URL Prefixes
|
||||||
USE_HTTPS = (get_secret('USE_HTTPS') == 'True')
|
USE_HTTPS = (get_secret('USE_HTTPS') == 'True')
|
||||||
URL_PREFIX = 'https://' if USE_HTTPS else 'http://'
|
URL_PREFIX = 'https://' if USE_HTTPS else 'http://'
|
||||||
BACKEND_URL = URL_PREFIX + get_secret('BACKEND_URL')
|
BACKEND_URL = URL_PREFIX + \
|
||||||
FRONTEND_URL = URL_PREFIX + get_secret('FRONTEND_URL')
|
get_secret('BACKEND_ADDRESS') + ':' + get_secret('BACKEND_PORT')
|
||||||
|
FRONTEND_URL = URL_PREFIX + \
|
||||||
|
get_secret('FRONTEND_ADDRESS') + ':' + get_secret('FRONTEND_PORT')
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
CSRF_TRUSTED_ORIGINS = [
|
CSRF_TRUSTED_ORIGINS = [
|
||||||
|
|
|
@ -10,7 +10,7 @@ services:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
image: drf_template:latest
|
image: drf_template:latest
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
||||||
environment:
|
environment:
|
||||||
- PYTHONBUFFERED=1
|
- PYTHONBUFFERED=1
|
||||||
- RUN_TYPE=web
|
- RUN_TYPE=web
|
||||||
|
|
Loading…
Reference in a new issue