Merge pull request #4 from Fayorg/master
Merging last changes made on the master branch
This commit is contained in:
commit
11d7203304
|
@ -1,3 +1 @@
|
||||||
.next/
|
|
||||||
node_modules/
|
|
||||||
.env.example
|
.env.example
|
|
@ -16,6 +16,7 @@ env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
# github.repository as <account>/<repo>
|
# github.repository as <account>/<repo>
|
||||||
IMAGE_NAME: fayorg/calendrier-avant
|
IMAGE_NAME: fayorg/calendrier-avant
|
||||||
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
39
Dockerfile
39
Dockerfile
|
@ -1,37 +1,48 @@
|
||||||
FROM node:18-alpine AS deps
|
FROM node:18-alpine AS base
|
||||||
|
|
||||||
|
# 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.
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN apk add --no-cache libc6-compat
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json* ./
|
|
||||||
|
# Install dependencies based on the preferred package manager
|
||||||
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
||||||
RUN \
|
RUN \
|
||||||
if [ -f package-lock.json ]; then npm ci; \
|
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||||
|
elif [ -f package-lock.json ]; then npm ci; \
|
||||||
|
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \
|
||||||
else echo "Lockfile not found." && exit 1; \
|
else echo "Lockfile not found." && exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FROM node:18-alpine AS builder
|
|
||||||
|
# 2. Rebuild the source code only when needed
|
||||||
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
|
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:18-alpine AS runner
|
# 3. Production image, copy all the files and run next
|
||||||
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup -g 1001 -S nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
RUN adduser -S nextjs -u 1001
|
||||||
|
|
||||||
COPY --from=builder /app/next.config.js ./
|
# COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/sentry.properties ./
|
|
||||||
COPY --from=builder /app/.sentryclirc ./
|
# Automatically leverage output traces to reduce image size
|
||||||
COPY --from=builder /app/public ./public
|
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import LoginForm from "@components/custom"
|
|
||||||
export default function LoginPage() {
|
|
||||||
return (
|
|
||||||
<main className="flex items-center justify-center md:h-screen">
|
|
||||||
<div className="relative mx-auto flex w-full max-w-[400px] flex-col space-y-2.5 p-4 md:-mt-32">
|
|
||||||
<div className="flex h-20 w-full items-end rounded-lg bg-blue-500 p-3 md:h-36">
|
|
||||||
<div className="w-32 text-white md:w-36">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<LoginForm />
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,4 +1,6 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {}
|
const nextConfig = {
|
||||||
|
output: 'standalone',
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig;
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"],
|
"@/*": ["./*"],
|
||||||
"@components/*": ["./components/*"],
|
"@components/*": ["./components/*"],
|
||||||
"@lib/*": ["lib/*"],
|
"@lib/*": ["./lib/*"],
|
||||||
"@styles/*": ["/styles/*"],
|
"@styles/*": ["/styles/*"],
|
||||||
"@santa/*": ["images/santa/*"],
|
"@santa/*": ["./images/santa/*"],
|
||||||
"@images/*": ["images/*"],
|
"@images/*": ["./images/*"],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||||
|
|
Loading…
Reference in New Issue