mirror of
https://github.com/runyanjake/cooking.git
synced 2026-03-26 01:43:17 -07:00
Dockerize
This commit is contained in:
parent
153c73f438
commit
74ee07d64f
@ -13,7 +13,9 @@
|
||||
"Bash(timeout 10 npm run dev:*)",
|
||||
"Bash(grep:*)",
|
||||
"Read(//c/Users/runya/Documents/repositories/recipes/recipes/docs/**)",
|
||||
"Bash(node scripts/import-recipes.js:*)"
|
||||
"Bash(node scripts/import-recipes.js:*)",
|
||||
"Bash(powershell.exe -Command \"Test-Path ''c:\\\\Users\\\\runya\\\\Documents\\\\repositories\\\\cooking\\\\.next\\\\standalone\\\\server.js''\")",
|
||||
"Bash(powershell.exe -Command:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
11
.dockerignore
Normal file
11
.dockerignore
Normal file
@ -0,0 +1,11 @@
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.gitignore
|
||||
.claude
|
||||
*.md
|
||||
!README.md
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
.dockerignore
|
||||
.env*
|
||||
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=build /app/public ./public
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
@ -1,2 +1,4 @@
|
||||
# cooking
|
||||
Content-first recipe site.
|
||||
A content-first recipe site. See it in action [HERE](https://recipes.whitney.rip).
|
||||
|
||||
|
||||
|
||||
@ -35,8 +35,7 @@ export default function AboutPage() {
|
||||
Each recipe is organized in its own folder with:
|
||||
</p>
|
||||
<ul className="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 ml-4">
|
||||
<li>MDX file with recipe content and instructions</li>
|
||||
<li>metadata.json for tags and organization</li>
|
||||
<li>MDX file with metadata frontmatter, recipe content, and instructions</li>
|
||||
<li>Assets folder for images and other media</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@ -64,7 +64,7 @@ export default function Home() {
|
||||
<div className="w-full md:w-2/5 space-y-4 text-center md:text-left">
|
||||
<h2 className="text-3xl font-bold text-gray-900 dark:text-white">But Recipe Sites Suck!</h2>
|
||||
<p className="text-lg text-gray-600 dark:text-gray-400">
|
||||
Monetized recipe sites don't bother me, but I do mind when sites have overly aggressive ad integrations that block or move around the main content. Many modern sites share the same user-unfriendly plugins.
|
||||
Monetized recipe sites don't bother me, but I do mind when sites have overly aggressive ad integrations that block or move around the main content. Many modern sites share the same user-unfriendly plugins.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
@ -0,0 +1,16 @@
|
||||
services:
|
||||
cooking:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- traefik
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.cooking.rule=Host(`recipes.whitney.rip`)"
|
||||
- "traefik.http.routers.cooking.entrypoints=websecure"
|
||||
- "traefik.http.routers.cooking.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.cooking.loadbalancer.server.port=3000"
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
||||
@ -2,6 +2,7 @@ import type { NextConfig } from "next";
|
||||
import createMDX from '@next/mdx';
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: 'standalone',
|
||||
reactStrictMode: true,
|
||||
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user