Skip to content

Commit

Permalink
Merge pull request #4 from ueberdosis/development
Browse files Browse the repository at this point in the history
docker build
  • Loading branch information
mkriegeskorte authored Jul 3, 2024
2 parents 67c8f48 + 921e2db commit eb66663
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
*Dockerfile*
npm-debug.log
node_modules
.env
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ name: deploy

on:
workflow_dispatch:
push:
branches:
- main
- development

jobs:
deploy:
Expand Down
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
FROM node:20-alpine AS base

ARG BASE_PATH

ARG NEXT_PUBLIC_ENVIRONMENT
ARG NEXT_PUBLIC_DOMAIN
ARG NEXT_PUBLIC_BASE_PATH
ARG NEXT_PUBLIC_REPO_BASE
ARG NEXT_PUBLIC_DEMO_URL
ARG NEXT_PUBLIC_DEMO_URL_PRO

ARG NEXT_PUBLIC_DOCSEARCH_HOST
ARG NEXT_PUBLIC_DOCSEARCH_PORT
ARG NEXT_PUBLIC_DOCSEARCH_PROTOCOL
ARG NEXT_PUBLIC_DOCSEARCH_INDEX
ARG NEXT_PUBLIC_DOCSEARCH_API_KEY

ARG NEXT_PUBLIC_GTM_ID
ARG NEXT_PUBLIC_COOKIEBOT_ID

ARG NEXT_TELEMETRY_DISABLED

RUN apk add --no-cache curl

# 1. Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand Down
33 changes: 16 additions & 17 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import createMdx from "@next/mdx";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import rehypeHighlight from "rehype-highlight";
import remarkGfm from "remark-gfm";
import createMdx from '@next/mdx'
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import rehypeHighlight from 'rehype-highlight'
import remarkGfm from 'remark-gfm'

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.(".svg"),
);
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'))

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
Expand All @@ -24,18 +23,18 @@ const nextConfig = {
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"],
use: ['@svgr/webpack'],
},
);
)

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;
fileLoaderRule.exclude = /\.svg$/i

return config;
return config
},
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
images: { unoptimized: true },
basePath: process.env.BASE_PATH ?? "",
basePath: process.env.BASE_PATH ?? '',
async redirects() {
return [
{
Expand All @@ -45,13 +44,13 @@ const nextConfig = {
},
]
},
};
}

const withMDX = createMdx({
options: {
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm],
rehypePlugins: [rehypeHighlight],
},
});
})

export default withMDX(nextConfig);
export default withMDX(nextConfig)
Loading

0 comments on commit eb66663

Please sign in to comment.