My personal site. theclashfruit.me
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: deploy with docker

+206
+107
.dockerignore
··· 1 + # Dependencies (installed inside Docker, never copied) 2 + node_modules/ 3 + .pnpm-store/ 4 + npm-debug.log* 5 + yarn-debug.log* 6 + yarn-error.log* 7 + pnpm-debug.log* 8 + lerna-debug.log* 9 + 10 + # Next.js build outputs (always generated during `next build`) 11 + .next/ 12 + out/ 13 + dist/ 14 + build/ 15 + .vercel/ 16 + 17 + # Tests and testing output (not needed in production images) 18 + coverage/ 19 + .nyc_output/ 20 + __tests__/ 21 + __mocks__/ 22 + jest/ 23 + cypress/ 24 + cypress/screenshots/ 25 + cypress/videos/ 26 + playwright-report/ 27 + test-results/ 28 + .vitest/ 29 + vitest.config.* 30 + jest.config.* 31 + cypress.config.* 32 + playwright.config.* 33 + *.test.* 34 + *.spec.* 35 + 36 + # Local development and editor files 37 + .git/ 38 + .gitignore 39 + .gitattributes 40 + .vscode/ 41 + .idea/ 42 + *.swp 43 + *.swo 44 + *~ 45 + *.log 46 + 47 + # Environment variables (only commit template files) 48 + .env 49 + .env*.local 50 + .env.development 51 + .env.test 52 + .env.production.local 53 + 54 + # Docker configuration files (not needed inside build context) 55 + Dockerfile* 56 + .dockerignore 57 + compose.yaml 58 + compose.yml 59 + docker-compose*.yaml 60 + docker-compose*.yml 61 + 62 + # Documentation 63 + *.md 64 + docs/ 65 + 66 + # CI/CD configuration files 67 + .github/ 68 + .gitlab-ci.yml 69 + .travis.yml 70 + .circleci/ 71 + Jenkinsfile 72 + 73 + # Cache directories and temporary data 74 + .cache/ 75 + .parcel-cache/ 76 + .eslintcache 77 + .stylelintcache 78 + .swc/ 79 + .turbo/ 80 + .tmp/ 81 + .temp/ 82 + 83 + # TypeScript build metadata 84 + *.tsbuildinfo 85 + 86 + # Sensitive or unnecessary configuration files 87 + *.pem 88 + .editorconfig 89 + .prettierrc* 90 + prettier.config.* 91 + .eslintrc* 92 + eslint.config.* 93 + .stylelintrc* 94 + stylelint.config.* 95 + .babelrc* 96 + *.iml 97 + *.ipr 98 + *.iws 99 + 100 + # OS-specific junk 101 + .DS_Store 102 + ._* 103 + .Spotlight-V100 104 + .Trashes 105 + ehthumbs.db 106 + Thumbs.db 107 + Desktop.ini
+7
.env.example
··· 1 + # Prod 2 + DB_USER= 3 + DB_PASSWORD= 4 + DB_NAME= 5 + 6 + # Dev 7 + DATABASE_URL=
+1
.gitignore
··· 32 32 33 33 # env files (can opt-in for committing if needed) 34 34 .env* 35 + !.env.example 35 36 36 37 # vercel 37 38 .vercel
+65
Dockerfile
··· 1 + ARG NODE_VERSION=25.8.1-slim 2 + 3 + # Dependencies 4 + FROM node:${NODE_VERSION} AS dependencies 5 + 6 + WORKDIR /app 7 + 8 + COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ 9 + 10 + RUN --mount=type=cache,target=/root/.npm \ 11 + --mount=type=cache,target=/usr/local/share/.cache/yarn \ 12 + --mount=type=cache,target=/root/.local/share/pnpm/store \ 13 + if [ -f package-lock.json ]; then \ 14 + npm ci --no-audit --no-fund; \ 15 + elif [ -f yarn.lock ]; then \ 16 + corepack enable yarn && yarn install --frozen-lockfile --production=false; \ 17 + elif [ -f pnpm-lock.yaml ]; then \ 18 + corepack enable pnpm && pnpm install --frozen-lockfile; \ 19 + else \ 20 + echo "No lockfile found." && exit 1; \ 21 + fi 22 + 23 + # Build 24 + FROM node:${NODE_VERSION} AS builder 25 + 26 + WORKDIR /app 27 + 28 + COPY --from=dependencies /app/node_modules ./node_modules 29 + COPY . . 30 + 31 + ENV NODE_ENV=production 32 + ENV NEXT_TELEMETRY_DISABLED=1 33 + 34 + RUN if [ -f package-lock.json ]; then \ 35 + npm run build; \ 36 + elif [ -f yarn.lock ]; then \ 37 + corepack enable yarn && yarn build; \ 38 + elif [ -f pnpm-lock.yaml ]; then \ 39 + corepack enable pnpm && pnpm build; \ 40 + else \ 41 + echo "No lockfile found." && exit 1; \ 42 + fi 43 + 44 + # Runner 45 + FROM node:${NODE_VERSION} AS runner 46 + 47 + WORKDIR /app 48 + 49 + ENV NODE_ENV=production 50 + ENV NEXT_TELEMETRY_DISABLED=1 51 + 52 + COPY --from=builder --chown=node:node /app/public ./public 53 + 54 + RUN mkdir .next 55 + RUN chown node:node .next 56 + 57 + COPY --from=builder --chown=node:node /app/.next/standalone ./ 58 + COPY --from=builder --chown=node:node /app/.next/static ./.next/static 59 + COPY --from=builder --chown=node:node /app/.next/cache ./.next/cache 60 + 61 + USER node 62 + 63 + EXPOSE 3000 64 + 65 + CMD ["node", "server.js"]
+25
docker-compose.yml
··· 1 + services: 2 + website: 3 + build: 4 + context: . 5 + dockerfile: Dockerfile 6 + container_name: website 7 + environment: 8 + - NODE_ENV=production 9 + - DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME} 10 + ports: 11 + - '${APP_PORT}:3000' 12 + restart: unless-stopped 13 + db: 14 + image: postgres 15 + shm_size: 128mb 16 + environment: 17 + - POSTGRES_USER=${DB_USER} 18 + - POSTGRES_PASSWORD=${DB_PASSWORD} 19 + - POSTGRES_DB=${DB_NAME} 20 + volumes: 21 + - tcf_web_pg:/var/lib/postgresql/ 22 + restart: unless-stopped 23 + 24 + volumes: 25 + tcf_web_pg:
+1
next.config.ts
··· 3 3 import type { NextConfig } from 'next'; 4 4 5 5 const nextConfig: NextConfig = { 6 + output: 'standalone', 6 7 pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], 7 8 turbopack: { 8 9 rules: {