Skip to content

Commit b94e602

Browse files
committed
Some minor updates.
1 parent bfa0803 commit b94e602

File tree

3 files changed

+49
-22
lines changed

3 files changed

+49
-22
lines changed

Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
server: backend
44
backend:
5+
@docker-compose up -d
56
@python manage.py runserver
67

78
frontend:
@@ -23,10 +24,12 @@ clean:
2324
@find . -type d -name '__pycache__' -delete
2425

2526
reset-db:
26-
@sudo -iu postgres bash -c "psql -c 'DROP DATABASE IF EXISTS coobs;'"
27-
@sudo -iu postgres bash -c "psql -c 'CREATE DATABASE coobs;'"
28-
@sudo -iu postgres bash -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE coobs TO coobs;'"
29-
@sudo -iu postgres bash -c "psql -c 'ALTER USER coobs CREATEDB;'"
27+
@psql -h localhost -U postgres -c "DROP DATABASE IF EXISTS coobs;"
28+
@psql -h localhost -U postgres -c "CREATE DATABASE coobs;"
29+
@psql -h localhost -U postgres -c "DROP ROLE IF EXISTS coobs;"
30+
@psql -h localhost -U postgres -c "CREATE ROLE coobs WITH LOGIN CREATEDB PASSWORD 'coobspass';"
31+
@psql -h localhost -U postgres -c "ALTER DATABASE coobs OWNER TO coobs;"
32+
@psql -h localhost -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE coobs TO coobs;"
3033
@echo "\033[0;32mDB reset done! => Running migrations.."
3134
@$(MAKE) -s migration
3235
@echo "\033[0;32mMigrations done! => Creating superuser.."

docker-compose.yml

+40-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
1-
# Tools
2-
postgres:
3-
image: postgres
4-
ports:
5-
- "5432:5432"
6-
volumes_from:
7-
- 'data'
8-
environment:
9-
POSTGRES_USER: "postgres"
10-
POSTGRES_PASSWORD: "postgres"
11-
volumes:
12-
- "/tmp:/tmp"
1+
version: "3.8"
132

14-
data:
15-
image: busybox
16-
volumes:
17-
- ./data:/data
3+
services:
4+
postgres:
5+
container_name: postgres
6+
image: postgres:12.1
7+
hostname: postgres
8+
environment:
9+
POSTGRES_USER: postgres
10+
POSTGRES_PASSWORD: postgres
11+
ports:
12+
- "5432:5432"
13+
volumes:
14+
- 'pg_data:/var/lib/postgresql/data'
15+
networks:
16+
close:
17+
aliases:
18+
- postgres
19+
20+
pgadmin:
21+
container_name: pgadmin
22+
image: dpage/pgadmin4:6.21
23+
environment:
24+
25+
- PGADMIN_DEFAULT_PASSWORD=admin
26+
ports:
27+
- "5050:80"
28+
volumes:
29+
- 'pgadmin_data:/var/lib/pgadmin'
30+
networks:
31+
close:
32+
aliases:
33+
- pgadmin
34+
35+
networks:
36+
close:
37+
driver: bridge
38+
39+
volumes:
40+
pg_data:
41+
pgadmin_data:

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ markdownify==0.6.5
3535
MarkupSafe==1.1.1
3636
mccabe==0.6.1
3737
openapi-codec==1.3.2
38-
Pillow==8.2.0
38+
Pillow==8.3.2
3939
psycopg2==2.8.6
4040
pycparser==2.20
4141
Pygments==2.8.1
@@ -53,7 +53,7 @@ six==1.15.0
5353
soupsieve==2.2
5454
sqlparse==0.4.1
5555
tinycss2==1.1.0
56-
typed-ast==1.4.2
56+
typed-ast==1.5.4
5757
uritemplate==3.0.1
5858
urllib3==1.26.5
5959
webencodings==0.5.1

0 commit comments

Comments
 (0)