Skip to content

Commit 167d8d5

Browse files
committed
chore: add dockerignore
1 parent 8bee17d commit 167d8d5

File tree

6 files changed

+69
-21
lines changed

6 files changed

+69
-21
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.github
3+
build
4+
node_modules
5+
*.md

CONTRIBUTING.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
# Contributing
22

3-
## Technological stack
3+
This outlines all practices for contributing to this project.
4+
5+
## Technologies
46

57
The project uses the Nodejs runtime environment but aims to use minimal
68
dependencies in order to create small bundle sizes.
79

8-
## Git methodology
10+
The software is shipped in Docker images.
11+
12+
## Security
13+
14+
The software is intended to be run on
15+
[Nodejs 16.18.0 LTS](https://nodejs.org/en/) and all released versions have 0
16+
vulnerabilities in NPM audits. This check is carried out as part of the release
17+
procedure.
18+
19+
The software relies on the
20+
[Nodejs HTTP module](https://nodejs.org/api/http.html) and will be vulnerable to
21+
any vulnerabilities in that module.
22+
23+
The software has been tested for
24+
[LFI](https://www.johanbook.com/docs/security/vulnerabilities/lfi)
25+
vulnerabilities.
26+
27+
## Development practices
928

10-
This project uses `main` as development branch. New features are committed
11-
through feature branches and merged into main through pull requests.
29+
### Git methodology
1230

13-
## Release management
31+
This project uses
32+
[main as development branch](https://unixsheikh.com/tutorials/a-simple-git-workflow-using-main-as-the-development-branch.html)
33+
to allow bleeding edge on main. New features are committed through feature
34+
branches and merged into main through pull requests.
35+
36+
### Release management
1437

1538
This project uses [semver](https://semver.org/), handled by the NPM package
1639
[standard-version](https://www.npmjs.com/package/standard-version). For creating
@@ -20,3 +43,10 @@ a new release, run the following commands:
2043
npm run release
2144
git push --follow-tags origin main
2245
```
46+
47+
Before creating a new release, confirm that there are no known vulnerabilities
48+
in the project dependencies by running
49+
50+
```sh
51+
npm audit
52+
```

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ RUN npm ci
1010

1111
USER node
1212

13-
CMD ["node", "server.js"]
13+
CMD ["node", "src"]
1414

1515
EXPOSE 8080

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ in a production environment_
77
different folders depending on the HTTP `Host` header. It is mainly intended to
88
run an internal network with its own DNS server.
99

10-
## Configuration
10+
## Get started
11+
12+
The server can be run either via a Nodejs runtime or through Docker.
13+
14+
### Folder structure
1115

1216
Create an asset folder, named `build` by default. In this folder create one
1317
folder for each domain that should be served. These folders should contain the
@@ -29,18 +33,10 @@ build/mycat.com/index.html
2933
build/mycat.com/script.js
3034
```
3135

32-
### Environmental variables
33-
34-
The following can be configured as environment variables:
35-
36-
- **DEFAULT_INDEX_FILE** name of file served on paths ending with a trailing
37-
slash (default `index.html`).
38-
- **PORT** the port the server should listen on (default 8080).
39-
- **ROOT_FILE_PATH** root directory of served file tree (default `build`).
40-
41-
## Docker
36+
### Using Docker
4237

43-
The server can be run through Docker
38+
The server can be run through Docker by mounting in the served directory as a
39+
volume. To the serve the `build` folder in the current directory, run
4440

4541
```sh
4642
docker run \
@@ -51,6 +47,22 @@ docker run \
5147
johanbook/file-domain-server:latest
5248
```
5349

50+
The Docker images are available for multiple architectures, including armv7.
51+
52+
## Configuration
53+
54+
The following can be configured as environment variables:
55+
56+
- **DEFAULT_INDEX_FILE** name of file served on paths ending with a trailing
57+
slash (default `index.html`).
58+
- **PORT** the port the server should listen on (default 8080).
59+
- **ROOT_FILE_PATH** root directory of served file tree (default `build`).
60+
61+
## Documentation
62+
63+
For documentation on technologies, security aspect and similar, see the
64+
[contributions file](./CONTRIBUTING.md).
65+
5466
## Contributing
5567

5668
For contributions and development procedures, see the

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "domain-file-server",
33
"version": "1.0.1",
4-
"description": "",
4+
"description": "a simplistic file server for multiple domains",
55
"main": "index.js",
66
"scripts": {
7-
"release": "standard-version"
7+
"release": "standard-version",
8+
"serve": "node src"
89
},
910
"keywords": [],
10-
"author": "",
11+
"author": "Johan Book",
1112
"license": "ISC",
1213
"devDependencies": {
1314
"prettier": "^2.7.1",
File renamed without changes.

0 commit comments

Comments
 (0)