File tree 15 files changed +156
-121
lines changed
15 files changed +156
-121
lines changed Original file line number Diff line number Diff line change @@ -30,27 +30,19 @@ RUN ./install-packages.sh
30
30
# ----------------------------------------------------
31
31
# Install dependencies
32
32
# ----------------------------------------------------
33
- FROM common-base AS dependencies
33
+ FROM common-base AS app-run
34
+
34
35
ENV PATH="/opt/venv/bin:$PATH"
35
36
36
- # apt-get install build-essential -y
37
37
COPY requirements.txt /app/
38
-
39
- RUN pip install --target /opt/packages -r requirements.txt
40
-
41
- # ----------------------------------------------------
42
- # Copy project
43
- # ----------------------------------------------------
44
- FROM common-base AS app-run
45
- COPY --from=dependencies /opt/packages /opt/packages
46
- ENV PYTHONPATH "${PYTHONPATH}:/opt/packages"
47
- # ENV PYTHONPATH="$PYTHONPATH:/app/lemarche:/app/config"
48
38
COPY ./ark ./ark
49
39
COPY ./ark_import ./ark_import
50
40
COPY ./arklet ./arklet
51
41
COPY ./manage.py ./manage.py
52
42
COPY ./docker/entrypoint.sh ./entrypoint.sh
53
43
44
+ RUN pip install -r requirements.txt
45
+
54
46
# ----------------------------------------------------
55
47
# Run Dev
56
48
# ----------------------------------------------------
Original file line number Diff line number Diff line change
1
+ version : " 3.7"
2
+
3
+ services :
4
+ arklet-minter :
5
+ container_name : arklet_minter
6
+ restart : always
7
+ build :
8
+ context : .
9
+ target : prod
10
+ dockerfile : ./Dockerfile
11
+ command : /app/entrypoint.sh
12
+ volumes :
13
+ - ./ark:/app/ark
14
+ - ./arklet:/app/arklet
15
+ - static_volume:/app/static
16
+ env_file :
17
+ - ./docker/env.prod
18
+ env :
19
+ - ARKLET_PORT : 8001
20
+ expose :
21
+ - 8001
22
+
23
+ arklet-resolver :
24
+ container_name : arklet_resolver
25
+ restart : always
26
+ build :
27
+ context : .
28
+ target : prod
29
+ dockerfile : ./Dockerfile
30
+ command : /app/entrypoint.sh
31
+ volumes :
32
+ - ./ark:/app/ark
33
+ - ./arklet:/app/arklet
34
+ - static_volume:/app/static
35
+ env_file :
36
+ - ./docker/env.prod
37
+ env :
38
+ - ARKLET_PORT : 8000
39
+ - RESOLVER : true
40
+ expose :
41
+ - 8000
42
+
43
+ nginx :
44
+ build : ./nginx
45
+ ports :
46
+ - 80:80
47
+ - 8080:8080
48
+ depends_on :
49
+ - arklet-minter
50
+ - arklet-resolver
51
+ volumes :
52
+ - static_volume:/app/static
53
+
54
+ volumes :
55
+ static_volume :
Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ services:
8
8
context : .
9
9
target : prod
10
10
dockerfile : ./Dockerfile
11
- command : /app/entrypoint.sh
11
+ command : /app/entrypoint.prod. sh
12
12
volumes :
13
13
- ./ark:/app/ark
14
- - ./ark_import:/app/ark_import
15
14
- ./arklet:/app/arklet
16
15
env_file :
17
16
- ./docker/env.postgres.prod
@@ -26,10 +25,9 @@ services:
26
25
context : .
27
26
target : prod
28
27
dockerfile : ./Dockerfile
29
- command : /app/entrypoint.sh
28
+ command : /app/entrypoint.prod. sh
30
29
volumes :
31
30
- ./ark:/app/ark
32
- - ./ark_import:/app/ark_import
33
31
- ./arklet:/app/arklet
34
32
env_file :
35
33
- ./docker/env.postgres.prod
Original file line number Diff line number Diff line change @@ -9,12 +9,11 @@ while ! pg_isready -h $ARKLET_POSTGRES_HOST -p $ARKLET_POSTGRES_PORT; do
9
9
sleep 1
10
10
done
11
11
12
- # Following rules depend on what you expect from django dev docker
13
- # ./manage.py collectstatic --noinput
14
- # ./manage.py compress --force
15
-
16
12
./manage.py migrate
17
- ./manage.py createsuperuser
18
13
19
- ./manage.py runserver 0.0.0.0:$ARKLET_PORT
20
- # gunicorn config.wsgi:application -w 2 -b :8880 --reload
14
+ if [ " $ENV " = " dev" ]; then
15
+ ./manage.py runserver 0.0.0.0:$ARKLET_PORT
16
+ else
17
+ ./manage.py collectstatic --noinput
18
+ gunicorn arklet.wsgi:application --bind 0.0.0.0:$ARKLET_PORT
19
+ fi
Original file line number Diff line number Diff line change
1
+ ARKLET_DJANGO_SECRET_KEY=local-test-secret ##ggignore
2
+ ARKLET_DEBUG=True
3
+ ARKLET_HOST=127.0.0.1
4
+
5
+ # Would be nice to undup these eventually
6
+ POSTGRES_DB=arklet
7
+ ARKLET_POSTGRES_NAME=arklet
8
+
9
+ POSTGRES_USER=postgres
10
+ ARKLET_POSTGRES_USER=postgres
11
+
12
+ POSTGRES_PASSWORD=postgres # ggignore
13
+ ARKLET_POSTGRES_PASSWORD=postgres # ggignore
14
+
15
+ POSTGRES_HOST=postgres
16
+ ARKLET_POSTGRES_HOST=postgres
17
+
18
+ POSTGRESQL_PORT=5432
19
+ ARKLET_POSTGRES_PORT=5432
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ARKLET_DJANGO_SECRET_KEY=
2
+
3
+ ARKLET_DEBUG=False
4
+ ARKLET_HOST=ark.frick.org
5
+
6
+ # Would be nice to undup these eventually
7
+ POSTGRES_DB=arklet
8
+ ARKLET_POSTGRES_NAME=arklet
9
+
10
+ POSTGRES_USER=arklet_user
11
+ ARKLET_POSTGRES_USER=arklet_user
12
+
13
+ POSTGRES_PASSWORD=
14
+ ARKLET_POSTGRES_PASSWORD=
15
+
16
+ POSTGRES_HOST=
17
+ ARKLET_POSTGRES_HOST=
18
+
19
+ POSTGRESQL_PORT=25060
20
+ ARKLET_POSTGRES_PORT=25060
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- default : prod
1
+ default : local
2
2
3
- prod :
4
- docker-compose -f docker-compose.prod.yml up
3
+ local :
4
+ docker-compose up --build
5
+
6
+ nginx :
7
+ docker-compose -f docker-compose.nginx.yml up --build
5
8
6
9
dev-cmd :
7
10
docker exec -it arklet_minter /bin/bash
8
11
9
12
dev-psql :
10
- source docker/env.postgres. local && docker exec -it arklet_db psql -U " $$ POSTGRES_USER" -d " $$ POSTGRES_DB"
13
+ source docker/env.local && docker exec -it arklet_db psql -U " $$ POSTGRES_USER" -d " $$ POSTGRES_DB"
Original file line number Diff line number Diff line change
1
+ FROM nginx:1.25
2
+
3
+ RUN rm /etc/nginx/conf.d/default.conf
4
+ COPY nginx.conf /etc/nginx/conf.d
Original file line number Diff line number Diff line change
1
+ upstream arklet_resolver {
2
+ # matches the container name and port in docker-compose.nginx.yml
3
+ server arklet_resolver:8000;
4
+ }
5
+
6
+ upstream arklet_minter {
7
+ # matches the container name and port in docker-compose.nginx.yml
8
+ server arklet_minter:8001;
9
+ }
10
+
11
+
12
+ server {
13
+
14
+ listen 80 ;
15
+
16
+ location / {
17
+ proxy_pass http://arklet_resolver;
18
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
19
+ proxy_set_header Host $host ;
20
+ proxy_redirect off ;
21
+ }
22
+
23
+ }
24
+
25
+ server {
26
+ listen 8080 ;
27
+
28
+ location / {
29
+ proxy_pass http://arklet_minter;
30
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
31
+ proxy_set_header Host $host ;
32
+ proxy_redirect off ;
33
+ }
34
+
35
+ location /static/ {
36
+ alias /app/static/;
37
+ }
38
+
39
+ }
You can’t perform that action at this time.
0 commit comments