Skip to content
Merged
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
54 changes: 54 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Dependencies (will be installed in Docker)
**/node_modules

# Build outputs (will be rebuilt in Docker)
**/.next
**/dist
**/build
**/out

# Development files
**/.gitignore
**/.env.local
**/.env.*.local

# IDE
**/.idea
**/.vscode
**/*.swp
**/*.swo

# Testing
**/coverage
**/e2e
**/test
**/*.test.*
**/*.spec.*
**/playwright
**/playwright-report

# Documentation
**/docs

# Misc
**/.DS_Store
**/Thumbs.db
**/*.log
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*

# Archives
**/*.tar
**/*.tar.gz
**/*.tar.lz4
**/*.zip

# Other packages not needed for linea-ens-app build
packages/linea-ccip-gateway
packages/linea-ens-resolver
packages/linea-ens-subgraph
packages/linea-state-verifier
packages/poh-signer-api
services

27 changes: 7 additions & 20 deletions packages/linea-ens-app/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"processors": [
"stylelint-processor-styled-components"
],
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-styled-components",
Expand All @@ -12,38 +10,27 @@
"selector-type-case": [
"lower",
{
"ignoreTypes": [
"/^\\$\\w+/"
]
"ignoreTypes": ["/^\\$\\w+/"]
}
],
"selector-type-no-unknown": [
true,
{
"ignoreTypes": [
"/-styled-mixin/",
"/^\\$\\w+/"
]
"ignoreTypes": ["/-styled-mixin/", "/^\\$\\w+/"]
}
],
"value-keyword-case": [
"lower",
{
"ignoreKeywords": [
"dummyValue",
"currentColor"
]
"ignoreKeywords": ["dummyValue", "currentColor"]
}
],
"declaration-colon-newline-after": null,
"declaration-empty-line-before": null,
"property-no-unknown": [
true,
{
"ignoreProperties": [
"flex-gap",
"webkit-appearance"
]
"ignoreProperties": ["flex-gap", "webkit-appearance"]
}
],
"color-function-notation": "legacy",
Expand All @@ -54,6 +41,6 @@
"rule-empty-line-before": null,
"keyframes-name-pattern": null,
"keyframe-block-no-duplicate-selectors": null,
"no-descending-specificity": false
"no-descending-specificity": null
}
}
}
57 changes: 36 additions & 21 deletions packages/linea-ens-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
FROM node:18

# Install system dependencies (if necessary)
RUN apt-get update && apt-get install -y \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
FROM node:22-alpine AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

RUN apk add --no-cache libc6-compat python3 make g++ git \
cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev

FROM base AS builder
WORKDIR /app

ARG NEXT_PUBLIC_ALCHEMY_KEY
ARG NEXT_PUBLIC_INFURA_KEY
ARG NEXT_PUBLIC_WC_PROJECT_ID
ARG NEXT_PUBLIC_THE_GRAPH_MAINNET_API_KEY
ARG NEXT_PUBLIC_THE_GRAPH_SEPOLIA_API_KEY

ENV NEXT_PUBLIC_ALCHEMY_KEY=$NEXT_PUBLIC_ALCHEMY_KEY
ENV NEXT_PUBLIC_INFURA_KEY=$NEXT_PUBLIC_INFURA_KEY
ENV NEXT_PUBLIC_WC_PROJECT_ID=$NEXT_PUBLIC_WC_PROJECT_ID
ENV NEXT_PUBLIC_THE_GRAPH_MAINNET_API_KEY=$NEXT_PUBLIC_THE_GRAPH_MAINNET_API_KEY
ENV NEXT_PUBLIC_THE_GRAPH_SEPOLIA_API_KEY=$NEXT_PUBLIC_THE_GRAPH_SEPOLIA_API_KEY
COPY . .

# Install pnpm and dependencies
RUN npm install -g [email protected]
RUN rm -rf node_modules
RUN pnpm config set store-dir ~/.local/share/pnpm/store
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./

COPY packages/linea-ens-app/package.json ./packages/linea-ens-app/
COPY packages/linea-ens-contracts/package.json ./packages/linea-ens-contracts/

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline

COPY .git ./.git

COPY packages/linea-ens-app/ ./packages/linea-ens-app/
COPY packages/linea-ens-contracts/ ./packages/linea-ens-contracts/

WORKDIR /app/packages/linea-ens-app
RUN pnpm build

# Clear Next.js cache
RUN rm -rf .next
RUN pnpm install
RUN pnpm run build
FROM node:22-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs

COPY --from=builder --chown=nextjs:nodejs /app/packages/linea-ens-app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/packages/linea-ens-app/.next/static ./packages/linea-ens-app/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/packages/linea-ens-app/public ./packages/linea-ens-app/public

EXPOSE 3000

CMD ["pnpm", "start"]
USER nextjs

CMD ["node", "packages/linea-ens-app/server.js"]
12 changes: 4 additions & 8 deletions packages/linea-ens-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// @ts-check

/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-param-reassign */
import { execSync } from 'child_process'
import path, { dirname } from 'path'
import { fileURLToPath } from 'url'

import { withSentryConfig } from '@sentry/nextjs'
import StylelintPlugin from 'stylelint-webpack-plugin'

Expand All @@ -24,6 +18,9 @@ const babelIncludeRegexes = [
* */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
// For monorepo support with pnpm - trace dependencies from the root
outputFileTracingRoot: path.join(__dirname, '../../'),
compiler: {
styledComponents: true,
},
Expand Down Expand Up @@ -91,8 +88,7 @@ const nextConfig = {
]
},
generateBuildId: () => {
const hash = execSync('git rev-parse HEAD').toString().trim()
return hash
return execSync('git rev-parse HEAD').toString().trim()
},
webpack: (config, options) => {
for (const rule of config.module.rules) {
Expand Down
Loading