Skip to content

Commit 3f7e20b

Browse files
authored
Procfile: run nginx via docker (#1376)
This should help: * standardise the nginx version running on different dev machines * simplify dev environment setup * standardise behaviour between central's deployed docker, and dev machines * streamline testing frontend-related changes to nginx config
1 parent 6f64628 commit 3f7e20b

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

Procfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vite: vite dev
22
build: vite build --mode development --watch
3-
nginx: nginx -c "$PWD/nginx-conf/main.conf" -p "$PWD"
3+
nginx-host: nginx -g "daemon off;" -c "$PWD/nginx-conf/nginx.conf" -p "$PWD"
4+
nginx-docker: docker run --rm --network=host -v "$PWD/nginx-conf":/etc/nginx/ -v "$PWD/.nginx":/etc/nginx/.nginx -v "$PWD/dist":/dist nginx:1.27.4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Follow these steps to set up your development environment:
3333

3434
- Install Node.js 20.
3535
- Install dependencies by running `npm install`.
36-
- Install NGINX.
36+
- Install docker or NGINX.
3737
- Set up [ODK Central Backend](https://github.com/getodk/central-backend).
3838
- You will need to create a user using an ODK Central Backend command line script.
3939
- You will probably also want to promote that user to a sitewide administrator.

docs/enketo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ODK Central Backend is already configured to connect with Enketo. The following
4747
},
4848
```
4949

50-
ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`./nginx-conf/main.conf`](../nginx-conf/main.conf) to create a reverse proxy to Enketo.
50+
ODK Central Frontend is also already configured for Enketo as well. The following lines should already be in [`./nginx-conf/nginx.conf`](../nginx-conf/nginx.conf) to create a reverse proxy to Enketo.
5151

5252
```
5353
location /- {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# This configuration file is for development only. For production, see
1212
# https://github.com/getodk/central.
1313

14-
daemon off;
1514
error_log stderr;
1615
pid ./.nginx/nginx.pid;
1716

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "nf start vite,nginx",
7-
"dev:build": "nf start build,nginx",
6+
"dev": " nf start vite,nginx-docker",
7+
"dev-no-docker": "nf start vite,nginx-host",
8+
"dev:build": "nf start build,nginx-docker",
9+
"dev-no-docker:build": "nf start build,nginx-host",
810
"build": "vite build",
911
"eslint": "eslint --max-warnings 0 --cache --ext .js,.vue src/ bin/ test/ e2e-tests/ *.js",
1012
"eslint:fix": "eslint --max-warnings 0 --fix --cache --ext .js,.vue src/ bin/ test/ *.js",

0 commit comments

Comments
 (0)