Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Commit ddf672c

Browse files
🐋 fix: Adjusting Docker Settings
1 parent 062c19e commit ddf672c

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

.env.example

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
SECRET_KEY="your_secret_key"
33

44
DEBUG=True
5-
SQLITE=True
5+
SQLITE=False
66

7-
ALLOWED_HOSTS="127.0.0.1, localhost"
7+
ALLOWED_HOSTS="127.0.0.1, localhost, 0.0.0.0"
88

9-
DATABASE_ENGINE="django.db.backends.sqlite3"
10-
DATABASE_NAME="db.sqlite3"
9+
# SQLite
10+
# DATABASE_ENGINE="django.db.backends.sqlite3"
11+
# DATABASE_NAME="db.sqlite3"
1112

12-
#PostgreSQL
13-
# DATABASE_ENGINE="django.db.backends.postgresql"
14-
# DATABASE_NAME="name-db"
13+
# PostgreSQL
14+
DATABASE_ENGINE="django.db.backends.postgresql"
15+
POSTGRES_DB="poupy-db"
1516

16-
DATABASE_USER="user"
17-
DATABASE_PASSWORD="password"
18-
DATABASE_HOST="127.0.0.1"
19-
DATABASE_PORT="5433"
17+
POSTGRES_USER="poupy"
18+
POSTGRES_PASSWORD="poupy12345@#$"
19+
POSTGRES_HOST="db-poupy"
20+
POSTGRES_PORT="5434"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ RUN /venv/bin/python manage.py collectstatic --noinput
2727

2828
EXPOSE 8000
2929

30-
CMD ["/venv/bin/gunicorn", "--bind", ":8000", "--workers", "2", "project.wsgi"]
30+
ENTRYPOINT ["./entrypoint.sh"]

docker-compose.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
services:
2-
postgres-poupy:
3-
container_name: postgres-poupy
2+
database:
3+
container_name: db-poupy
44
image: postgres:16.1-alpine
55
ports:
6-
- "5433:5433"
6+
- "5434:5434"
77
volumes:
8-
- /data:/var/lib/postgresql/data/
8+
- pgdata:/var/lib/postgresql/data/
99
env_file:
1010
- .env
1111
environment:
12-
- PGPORT=5433
12+
- PGPORT=5434
13+
restart: always
1314

14-
django-poupy:
15-
container_name: django-poupy
15+
app:
16+
container_name: app-poupy
17+
image: poupy:latest
1618
build:
1719
context: .
1820
dockerfile: Dockerfile
1921
ports:
20-
- "5010:8000"
22+
- "9001:8000"
2123
volumes:
2224
- ./project:/project
2325
env_file:
2426
- .env
2527
depends_on:
26-
- postgres-poupy
28+
- database
29+
restart: always
30+
31+
volumes:
32+
pgdata:

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
sleep 10
4+
5+
/venv/bin/python manage.py migrate
6+
7+
/venv/bin/gunicorn --bind :8000 --workers 2 project.wsgi

0 commit comments

Comments
 (0)