Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomanuel committed Nov 22, 2024
2 parents 6feabea + b94e602 commit 182a3b6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 22 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

server: backend
backend:
@docker-compose up -d
@python manage.py runserver

frontend:
Expand All @@ -23,10 +24,12 @@ clean:
@find . -type d -name '__pycache__' -delete

reset-db:
@sudo -iu postgres bash -c "psql -c 'DROP DATABASE IF EXISTS coobs;'"
@sudo -iu postgres bash -c "psql -c 'CREATE DATABASE coobs;'"
@sudo -iu postgres bash -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE coobs TO coobs;'"
@sudo -iu postgres bash -c "psql -c 'ALTER USER coobs CREATEDB;'"
@psql -h localhost -U postgres -c "DROP DATABASE IF EXISTS coobs;"
@psql -h localhost -U postgres -c "CREATE DATABASE coobs;"
@psql -h localhost -U postgres -c "DROP ROLE IF EXISTS coobs;"
@psql -h localhost -U postgres -c "CREATE ROLE coobs WITH LOGIN CREATEDB PASSWORD 'coobspass';"
@psql -h localhost -U postgres -c "ALTER DATABASE coobs OWNER TO coobs;"
@psql -h localhost -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE coobs TO coobs;"
@echo "\033[0;32mDB reset done! => Running migrations.."
@$(MAKE) -s migration
@echo "\033[0;32mMigrations done! => Creating superuser.."
Expand Down
56 changes: 40 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
# Tools
postgres:
image: postgres
ports:
- "5432:5432"
volumes_from:
- 'data'
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
volumes:
- "/tmp:/tmp"
version: "3.8"

data:
image: busybox
volumes:
- ./data:/data
services:
postgres:
container_name: postgres
image: postgres:12.1
hostname: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- 'pg_data:/var/lib/postgresql/data'
networks:
close:
aliases:
- postgres

pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:6.21
environment:
- PGADMIN_DEFAULT_EMAIL=admin@fiqus.coop
- PGADMIN_DEFAULT_PASSWORD=admin
ports:
- "5050:80"
volumes:
- 'pgadmin_data:/var/lib/pgadmin'
networks:
close:
aliases:
- pgadmin

networks:
close:
driver: bridge

volumes:
pg_data:
pgadmin_data:
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ markdownify==0.6.5
MarkupSafe==1.1.1
mccabe==0.6.1
openapi-codec==1.3.2
Pillow==8.2.0
Pillow==8.3.2
psycopg2==2.8.6
pycparser==2.20
Pygments==2.8.1
Expand All @@ -53,7 +53,7 @@ six==1.15.0
soupsieve==2.2
sqlparse==0.4.1
tinycss2==1.1.0
typed-ast==1.4.2
typed-ast==1.5.4
uritemplate==3.0.1
urllib3==1.26.5
webencodings==0.5.1
Expand Down

0 comments on commit 182a3b6

Please sign in to comment.