Commit f59b946 1 parent eda5982 commit f59b946 Copy full SHA for f59b946
File tree 4 files changed +89
-9
lines changed
4 files changed +89
-9
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
Original file line number Diff line number Diff line change
1
+ FROM node:18-slim
2
+
3
+ # Install rsync
4
+ RUN apt-get update && \
5
+ apt-get install -y rsync && \
6
+ rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR /app
9
+
10
+ # Create necessary directories
11
+ RUN mkdir -p src/javascripts \
12
+ src/scss \
13
+ application/static/javascripts \
14
+ application/static/stylesheets
15
+
16
+ # Set shell environment variable
17
+ ENV SHELL=/bin/bash
18
+
19
+ # Copy package files
20
+ COPY package*.json ./
21
+
22
+ # Install dependencies without running scripts
23
+ RUN npm install --ignore-scripts
24
+
25
+ # Set default command
26
+ CMD ["npm", "run", "watch"]
Original file line number Diff line number Diff line change @@ -10,27 +10,44 @@ Manage planning considerations through standards process
10
10
node 18
11
11
postgresql
12
12
13
- For loading data into db:
14
13
15
- heroku-cli
14
+ ## Running the app locally with docker
16
15
17
- [ heroku-cli] ( https://devcenter.heroku.com/articles/heroku-cli )
16
+ ### First time setup or when you need to rebuild assets
17
+
18
+ docker compose run --rm assets-build
19
+
20
+ ### Regular development (starts everything)
21
+
22
+ docker compose up
23
+
24
+ ### When you need to restore the database
25
+
26
+ docker compose down -v
27
+ docker compose up
18
28
19
29
20
- ## Get started
30
+ ## To run the app locally without docker
21
31
22
32
createdb dluhc-planning-considerations
23
33
make init
24
34
25
- ## Apply db migrations
35
+ ### Apply db migrations
26
36
flask db upgrade
27
37
28
38
29
- ## Load/update consideration data
39
+ ### For loading data into db you'll need the heroku-cli
40
+
41
+ heroku-cli
42
+
43
+ [ heroku-cli] ( https://devcenter.heroku.com/articles/heroku-cli )
44
+
45
+
46
+ ### Load/update consideration data
30
47
31
48
flask consider load-data
32
49
33
- ## Load/update questions
50
+ ### Load/update questions
34
51
35
52
Questions are [ here] ( application/question_sets.py )
36
53
@@ -42,12 +59,12 @@ To add/edit a question make changes [here](application/question_sets.py) then ru
42
59
43
60
Fix any errors then run the load command above
44
61
45
- ## Run app locally
62
+ ### Run app locally
46
63
47
64
flask run
48
65
49
66
50
- ## To test authentication in local development
67
+ ### To test authentication in local development
51
68
52
69
Set the following in DevelopmentConfig
53
70
Original file line number Diff line number Diff line change @@ -8,11 +8,20 @@ services:
8
8
- action : sync
9
9
path : .
10
10
target : /code
11
+ ignore :
12
+ - node_modules/
13
+ - .git/
14
+ - action : rebuild
15
+ path : requirements.txt
16
+ volumes :
17
+ - .:/code
11
18
depends_on :
12
19
- db
13
20
environment :
14
21
SECRET_KEY : " replaceinprod"
15
22
DATABASE_URL : " postgresql://postgres:password@db/planning-data-design"
23
+ FLASK_DEBUG : 1
24
+ PYTHONDONTWRITEBYTECODE : 1
16
25
networks :
17
26
- app-network
18
27
@@ -34,8 +43,35 @@ services:
34
43
networks :
35
44
- app-network
36
45
46
+ assets :
47
+ build :
48
+ context : .
49
+ dockerfile : Dockerfile.assets
50
+ volumes :
51
+ - .:/app
52
+ - node_modules:/app/node_modules
53
+ environment :
54
+ - NODE_ENV=development
55
+ - SHELL=/bin/bash
56
+ command : npm run watch
57
+ depends_on :
58
+ - web
59
+
60
+ # Optional one-time build service
61
+ assets-build :
62
+ build :
63
+ context : .
64
+ dockerfile : Dockerfile.assets
65
+ volumes :
66
+ - .:/app
67
+ - node_modules:/app/node_modules
68
+ command : npm run postinstall
69
+ profiles :
70
+ - build
71
+
37
72
volumes :
38
73
pgdata :
74
+ node_modules : # Persist node_modules to avoid reinstalling on every restart
39
75
40
76
networks :
41
77
app-network :
You can’t perform that action at this time.
0 commit comments