Skip to content

Commit

Permalink
Fix make file and for develop mode
Browse files Browse the repository at this point in the history
  • Loading branch information
The1Penguin committed Sep 5, 2024
1 parent 956b71a commit 6b12103
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
24 changes: 8 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,21 @@ export $(shell sed 's/=.*//' .env)
test:
env

# delete this
up-prod:
sudo -E docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
sudo -E docker-compose exec web /bin/sh -c "python3 manage.py migrate"
sudo -E docker-compose exec web /bin/sh -c "python3 manage.py compilemessages -l en"
sudo -E docker-compose exec web /bin/sh -c "python3 manage.py collectstatic --noinput"

# delete this too
up-develop:
# sleep 5 && sudo docker-compose exec web /bin/sh -c "python3 manage.py migrate" &
sudo -E docker-compose run web /bin/sh -c "python3 manage.py compilemessages -l en"
sudo -E docker-compose -f docker-compose.yml -f docker-compose.develop.yml up
docker compose run web /bin/sh -c "python3 manage.py compilemessages -l en"
docker compose -f docker-compose.yml -f docker-compose.develop.yml up

makemessages:
sudo -E docker compose exec web python3 manage.py makemessages -a
sudo -E docker compose cp web:/locale .
docker compose exec web python3 manage.py makemessages -a
docker compose cp web:/locale .

compilemessages:
sudo -E docker compose cp ./locale web:.
sudo -E docker compose exec web python3 manage.py compilemessages
docker compose cp ./locale web:.
docker compose exec web python3 manage.py compilemessages

build:
sudo -E docker-compose build
docker compose build

down:
sudo -E docker-compose down
docker compose down
5 changes: 4 additions & 1 deletion docker-compose.develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ version: '3.7'
services:
web:
# use wait for it script to make sure db is ready before launching
command: ["/scripts/wait-for-it.sh", "db:5432", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"]
command: ["/scripts/boot.sh"]
ports:
- "8000:8000"
volumes:
- ./dtekportal:/code
- ./scripts:/scripts
environment:
- DJANGO_DEBUG=1
5 changes: 5 additions & 0 deletions scripts/boot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

python3 manage.py migrate
python3 manage.py compilemessages
exec /scripts/wait-for-it.sh db:5432 -- python manage.py runserver 0.0.0.0:8000

0 comments on commit 6b12103

Please sign in to comment.