Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-8821 optionally enable json log #3522

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
COPY src ./src
COPY config/webpack ./config/webpack
ARG SC_THEME=default
ENV SC_THEME ${SC_THEME}

Check warning on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (n21)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (default)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (brb)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (thr)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
RUN NODE_ENV=production npm run build

COPY .git ./.git
Expand All @@ -28,6 +28,7 @@

# run stage
FROM docker.io/nginx:1.27
ENV NGINX_LOG_FORMAT main

Check warning on line 31 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (n21)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 31 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (default)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 31 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (brb)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 31 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push_nuxt (thr)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
RUN mkdir /etc/nginx/templates
COPY config/docker/nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build-stage /app/dist /usr/share/nginx/html/frontend
Expand Down
15 changes: 15 additions & 0 deletions config/docker/nginx.conf.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Conditionally enable json log
log_format json escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status": "$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"http_referrer":"$http_referer",'
'"http_user_agent":"$http_user_agent"'
'}';

server {
access_log /var/log/nginx/access.log ${NGINX_LOG_FORMAT};
listen 4000;
server_name localhost;

Expand Down
Loading