Skip to content
Open
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
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

# Setup build env
ARG VERSION=unversioned
ARG SENTRY_AUTH_TOKEN

Check warning on line 24 in Dockerfile

View workflow job for this annotation

GitHub Actions / Tests / Build and scan frontend container image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "SENTRY_AUTH_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN"

Check warning on line 25 in Dockerfile

View workflow job for this annotation

GitHub Actions / Tests / Build and scan frontend container image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "SENTRY_AUTH_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG GHOST_API_URL
ENV GHOST_API_URL="$GHOST_API_URL"
ARG GHOST_CONTENT_KEY

Check warning on line 28 in Dockerfile

View workflow job for this annotation

GitHub Actions / Tests / Build and scan frontend container image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "GHOST_CONTENT_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV GHOST_CONTENT_KEY="$GHOST_CONTENT_KEY"

Check warning on line 29 in Dockerfile

View workflow job for this annotation

GitHub Actions / Tests / Build and scan frontend container image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "GHOST_CONTENT_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

RUN apk add --no-cache jq && \
mv package.json package.json.bak && \
Expand All @@ -50,19 +50,18 @@
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/next-i18next.config.js ./
COPY --from=builder --chown=nextjs:nodejs /app/next.config.js ./
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./
# Copy standalone server and its dependencies
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
# Copy static assets to standalone directory
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

ENV PORT 3040
ENV PORT=3040

EXPOSE 3040

CMD [ "npm", "run", "start" ]
CMD [ "node", "server.js" ]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:3040 || exit 1
5 changes: 3 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { i18n } = require('./next-i18next.config')
*/
const moduleExports = {
i18n,
output: 'standalone',
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, 'src/styles')],
Expand Down Expand Up @@ -80,15 +81,15 @@ const moduleExports = {
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
}
]

return [
{
// Apply the headers to all routes
source: '/:path*',
headers: securityHeaders,
},
}
]
},
modularizeImports: {
Expand Down
Loading