File tree 6 files changed +27
-11
lines changed
6 files changed +27
-11
lines changed Original file line number Diff line number Diff line change
1
+ venv
2
+ .env *
Original file line number Diff line number Diff line change
1
+ FROM python:3.11 AS requirements
2
+ WORKDIR /app
3
+ COPY . /app
4
+ RUN ./scripts/generate-requirements.sh > ./unified_requirements.txt
5
+
1
6
FROM python:3.11
2
7
3
8
WORKDIR /app
@@ -9,14 +14,17 @@ ENV PYTHONUNBUFFERED 1
9
14
RUN apt-get update
10
15
RUN apt-get install gettext -y
11
16
12
- COPY requirements.txt /app/requirements .txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
- RUN pip install psycopg2-binary --force-reinstall --no-cache-dir ;
17
+ COPY --from= requirements /app/unified_requirements .txt /app/
18
+ RUN cat /app/unified_requirements.txt | pip install -r /dev/stdin;
19
+ RUN pip install psycopg2-binary;
15
20
16
21
COPY . /app
17
22
18
- RUN find . -name "requirements.txt" -print0 | xargs -0 -n1 pip install --upgrade -r;
23
+ RUN python manage.py collectstatic --noinput
24
+
25
+ RUN useradd -m -u 1001 -s /bin/bash app
26
+ USER 1001
19
27
20
- EXPOSE 8000
28
+ EXPOSE 8080
21
29
22
30
CMD ["/app/scripts/run-server.sh" ]
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ venv/touchfile: requirements.txt
14
14
touch venv/touchfile
15
15
16
16
install-requirements : venv/touchfile
17
- . venv/bin/activate && find . -name " requirements.txt " -print0 | xargs -0 -n1 pip install --upgrade -r ; \
17
+ . venv/bin/activate && ./scripts/generate- requirements.sh | pip install --upgrade -r /dev/stdin
18
18
. venv/bin/activate && pip install psycopg2-binary --force-reinstall --no-cache-dir; \
19
19
cd superapp/apps/admin_portal/tailwind && npm install
20
20
@@ -28,7 +28,7 @@ start-docker:
28
28
29
29
destroy-docker :
30
30
docker-compose stop
31
- docker-compose down
31
+ docker-compose down -v
32
32
33
33
migrate :
34
34
python3 manage.py migrate
@@ -63,4 +63,3 @@ create-fixtures:
63
63
64
64
load-fixtures :
65
65
python3 manage.py loaddata fixtures/initial_data.json
66
-
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ services:
2
2
postgres :
3
3
image : timescale/timescaledb-ha:pg16
4
4
restart : unless-stopped
5
+ shm_size : 2gb
5
6
volumes :
6
- - db_data:/var/lib/postgresql /data
7
+ - db_data:/home/postgres/pgdata /data
7
8
env_file :
8
9
- .env
9
10
ports :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ cat requirements.txt
6
+ find . -name " requirements.txt" -print0 | xargs -0 cat
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
-
3
2
set -e;
4
3
5
- python manage.py runserver 0.0.0.0:8000
4
+ python manage.py migrate
5
+ python manage.py runserver 0.0.0.0:8080
You can’t perform that action at this time.
0 commit comments