add support for configuring server url. fixes #11
This commit is contained in:
@@ -2,5 +2,12 @@ FROM nginx:alpine
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
RUN apk add gettext
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY docker/env.js.template /env.js.template
|
||||
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
COPY dist/ /var/www/html/
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
envsubst < env.js.template > /var/www/html/env.js
|
||||
exec "$@"
|
||||
@@ -0,0 +1,3 @@
|
||||
window.env = {
|
||||
SERVER_URL: "$SERVER_URL",
|
||||
}
|
||||
@@ -17,4 +17,8 @@ server {
|
||||
location = /index.html {
|
||||
add_header 'Cache-Control' 'no-cache';
|
||||
}
|
||||
|
||||
location = /env.js {
|
||||
add_header 'Cache-Control' 'no-cache';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user