You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
# Docker static webserver
4
4
5
5
A simple nginx docker image that has the ability to insert environment variables. Created so I could re-use an image between prod and staging environments for my frontend builds.
6
-
It replaces environment variables on container startup so you don´t have to rebuild your Docker image or use a server-side language to change some settings.
6
+
It replaces environment variables on container startup, so you don´t have to rebuild your Docker image or use a server-side language to change some settings.
A more modern example where you build your frontend project and ship it:
19
19
20
20
```Dockerfile
21
-
FROM node:18 as build
21
+
FROM node:21 as build
22
22
WORKDIR /opt/project
23
23
24
24
COPY package.json package-lock.json /opt/project/
@@ -62,8 +62,9 @@ You should use the latest available tag in [at in the registry](https://hub.dock
62
62
63
63
Due to the simple approach of finding & replacing the keywords there are some limitations:
64
64
- Please make sure your environment keys do not contain special characters. Only `a-z`, `A-Z`, `0-9` and `_` are recommended.
65
-
- By default, the script only changes files located in `/var/www`. You can change this by setting the `NGINX_ENVSUBST_WWW_DIR` environment variable.
66
-
- The project is not meant as a development environment. Don´t mount your code in here as it will only change envioronment variables on the first starutp.
65
+
- By default, the script only changes files located in `/var/www`. You can change this by setting the `NGINX_ENVSUBST_WWW_DIR` environment variable.
66
+
- Using es6 template literals can cause issues. You can fine-tune the replacement by configuring a filter with the `NGINX_ENVSUBST_FILTER` environment variable. This should allow you to set a prefix like `CONFIG_`.
67
+
- The project is not meant as a development environment. Don´t mount your code in here as it will only change environment variables on the first startup.
0 commit comments