Skip to content

Commit 188fa8d

Browse files
committed
Dockerfile og nginx konfig klargjort for å støtte ung-sak-web image build.
Legger til parametre i Dockerfile slik at build kan overstyre nødvendig konfigurasjon når ung-sak-web image skal byggast.
1 parent c5c0f28 commit 188fa8d

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Dockerfile

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
FROM nginxinc/nginx-unprivileged:stable-alpine-slim
2+
# These must be set when building for ung-sak-web. Defaults are for k9-sak-web
3+
ARG proxyConfig=proxy.nginx
4+
ARG featureToggles=feature-toggles.json
5+
ARG appVariant=k9
26

37
LABEL org.opencontainers.image.source=https://github.com/navikt/k9-sak-web
48

5-
ADD proxy.nginx /etc/nginx/conf.d/app.conf.template
6-
ADD feature-toggles.json /etc/nginx/conf.d/feature-toggles.json
9+
ADD $proxyConfig /etc/nginx/conf.d/app.conf.template
10+
ADD $featureToggles /etc/nginx/conf.d/feature-toggles.json
711
ADD start-server.sh /start-server.sh
812

913
ENV APP_DIR="/app" \
10-
APP_PATH_PREFIX="/k9/sak" \
11-
APP_CALLBACK_PATH="/k9/sak/cb" \
12-
APP_URL_SAK="http://k9-sak"
14+
APP_PATH_PREFIX="/$appVariant/sak" \
15+
APP_CALLBACK_PATH="/$appVariant/sak/cb" \
16+
APP_URL_SAK="http://$appVariant-sak"
1317

1418
COPY dist /usr/share/nginx/html
1519

proxy.nginx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ server {
4444
# Health check for NAIS
4545
location = /k9/feature-toggle/toggles.json {
4646
add_header Content-Type application/json;
47-
root /tmp/;
47+
alias /tmp/feature-toggle/toggles.json;
4848
}
4949

5050
location = /isAlive {

start-server.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ _shutdown_() {
1212
wait "$pid"
1313
}
1414
trap _shutdown_ SIGTERM
15-
[ -d /tmp/k9/feature-toggle ] && echo "Feature toggle-directory finnes fra før, tilbakestiller" && rm -r /tmp/k9/feature-toggle/* || mkdir -p /tmp/k9/feature-toggle
16-
envsubst < /etc/nginx/conf.d/feature-toggles.json > /tmp/k9/feature-toggle/toggles.json
15+
[ -d /tmp/feature-toggle ] && echo "Feature toggle-directory finnes fra før, tilbakestiller" && rm -r /tmp/feature-toggle/* || mkdir -p /tmp/feature-toggle
16+
envsubst < /etc/nginx/conf.d/feature-toggles.json > /tmp/feature-toggle/toggles.json
1717

1818
export APP_HOSTNAME="${HOSTNAME:-localhost}"
1919
export APP_PORT="${APP_PORT:-443}"
@@ -26,7 +26,7 @@ echo "### Nginx conf ###"
2626
cat /etc/nginx/conf.d/default.conf
2727
echo
2828
echo "### Feature toggles ###"
29-
cat /tmp/k9/feature-toggle/toggles.json
29+
cat /tmp/feature-toggle/toggles.json
3030

3131
nginx -g "daemon off;" &
3232
pid=$!

0 commit comments

Comments
 (0)