-
Notifications
You must be signed in to change notification settings - Fork 274
Feat/add coauthors 2 #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d693008
68980f7
584afb1
f2a8ede
b2ebff5
5b76869
ba9d380
9d15a0c
c39a66e
4376aeb
c05142a
ee7094a
9d202ea
5b3bf41
2f82cc3
67b1f1a
d8d6379
af78548
1108757
62858e7
cbdb1fb
b20b967
d6ffd49
4880c13
7f25a80
69c184b
8262bcc
4747744
ad86c0a
c96eb34
89e6384
1dfb571
b9f304a
f2864d4
0ab38aa
2ac8265
6497843
b9e96d3
460e0ea
53b9563
edc7a92
fec6a49
f0629be
8d8d519
39dbbd5
c289761
be9c7ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| WORDPRESS_URL="https://wordpress.com" | ||
| WORDPRESS_HOSTNAME="wordpress.com" | ||
| NEXT_PUBLIC_WORDPRESS_URL="https://sysblok.ru" | ||
| NEXT_PUBLIC_URL="https://next.sysblok.team" | ||
|
|
||
| # If using the revalidate plugin | ||
| # You can generate by running `openssl rand -base64 32` in the terminal | ||
| WORDPRESS_WEBHOOK_SECRET="your-secret-key-here" | ||
| NEXT_WORDPRESS_WEBHOOK_SECRET="your-secret-key-here" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # syntax=docker.io/docker/dockerfile:1 | ||
| # ============================================ | ||
| # Base Stage: Use a Lightweight Node.js Image | ||
| # ============================================ | ||
|
|
||
| # Use an official Node.js Alpine image | ||
| ARG NODE_VERSION=22.14.0-alpine | ||
| FROM node:${NODE_VERSION} AS base | ||
|
|
||
| # Set the working directory | ||
| WORKDIR /app | ||
|
|
||
| # ============================================ | ||
| # Stage 2: Install dependencies | ||
| # ============================================ | ||
| 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 | ||
|
|
||
| # Copy package related files | ||
| COPY package.json pnpm-lock.yaml ./ | ||
|
|
||
| # Enable pnpm | ||
| RUN corepack enable pnpm | ||
|
|
||
| # Install dependencies | ||
| RUN pnpm i --frozen-lockfile | ||
|
|
||
| # ============================================ | ||
| # Stage 3: Build Next.js app | ||
| # ============================================ | ||
| FROM base AS builder | ||
|
|
||
| # Copy node modules from dependencies | ||
| COPY --from=deps /app/node_modules ./node_modules | ||
|
|
||
| # Copy source code into the container | ||
| COPY . . | ||
|
|
||
| # Next.js collects completely anonymous telemetry data about general usage. | ||
| # Learn more here: https://nextjs.org/telemetry | ||
| # Following line disables telemetry. | ||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
|
||
| # Build the application | ||
| RUN npm run build | ||
|
|
||
| # ============================================ | ||
| # Stage 4: Create Production Image | ||
| # ============================================ | ||
| FROM base AS runner | ||
|
|
||
| ENV NODE_ENV=production | ||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
|
||
| RUN addgroup -g 1001 -S nodejs | ||
| RUN adduser -S nextjs -u 1001 | ||
|
|
||
| # Copy standalone build files | ||
| COPY --from=builder --chown=nextjs:nodejs /app/public ./public | ||
| COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
| COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
|
||
| # Set the port and hostname for the Next.js standalone server | ||
| ENV PORT=3000 | ||
| ENV HOSTNAME="0.0.0.0" | ||
|
|
||
| # Use nextjs user for security best practices | ||
| USER nextjs | ||
|
|
||
| # Expose port 3000 | ||
| EXPOSE 3000 | ||
|
|
||
| CMD ["node", "server.js"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # syntax=docker.io/docker/dockerfile:1 | ||
| # Use an official Node.js Alpine image | ||
| ARG NODE_VERSION=22.14.0-alpine | ||
| FROM node:${NODE_VERSION} AS base | ||
|
|
||
| # Set the working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy package related files | ||
| COPY package.json pnpm-lock.yaml ./ | ||
|
|
||
| # 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 | ||
|
|
||
| # Enable pnpm | ||
| RUN corepack enable pnpm | ||
|
|
||
| # Install dependencies | ||
| RUN pnpm i --frozen-lockfile | ||
|
|
||
| # Copy source code into the container | ||
| COPY . . | ||
|
|
||
| # Next.js collects completely anonymous telemetry data about general usage. | ||
| # Learn more here: https://nextjs.org/telemetry | ||
| # Following line disables telemetry. | ||
| ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
|
||
| # Expose port 3000 | ||
| EXPOSE 3000 | ||
|
|
||
| CMD ["npm", "run", "dev"] |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,90 @@ | ||||||||||
| # Variables | ||||||||||
| IMAGE_NAME = wp-nextjs | ||||||||||
| IMAGE_TAG = latest | ||||||||||
| CONTAINER_NAME = wp-nextjs-container | ||||||||||
| HOST_PORT = 3000 | ||||||||||
| CONTAINER_PORT = 3000 | ||||||||||
| DOCKERFILE = Dockerfile | ||||||||||
| NODE_VERSION = 22.14.0-alpine | ||||||||||
| NODE_ENV=production | ||||||||||
|
|
||||||||||
| # Default target | ||||||||||
| .PHONY: help | ||||||||||
| help: | ||||||||||
| @echo "Available commands:" | ||||||||||
| @echo " make build - Build the production Docker image" | ||||||||||
| @echo " make build-dev - Build the development Docker image and create container" | ||||||||||
| @echo " make run - Run the production Docker container" | ||||||||||
| @echo " make run-dev - Build and run the development Docker container" | ||||||||||
| @echo " make start-dev - Start the development Docker container" | ||||||||||
| @echo " make build-run - Build and run the production Docker container" | ||||||||||
| @echo " make stop - Stop the production Docker container" | ||||||||||
| @echo " make stop-dev - Stop the development Docker container" | ||||||||||
| @echo " make down-dev - Stop and remove the development Docker container" | ||||||||||
| @echo " make restart - Restart the production Docker container" | ||||||||||
| @echo " make restart-dev - Restart the development Docker container" | ||||||||||
| @echo " make logs - Show production container logs" | ||||||||||
| @echo " make clean - Remove production Docker image and container" | ||||||||||
|
|
||||||||||
| # Build the production Docker image | ||||||||||
| build: | ||||||||||
| docker build \ | ||||||||||
| --build-arg NODE_VERSION=$(NODE_VERSION) \ | ||||||||||
| -f $(DOCKERFILE) -t $(IMAGE_NAME):$(IMAGE_TAG) . | ||||||||||
|
|
||||||||||
| # Build the development Docker image and create container | ||||||||||
| build-dev: | ||||||||||
| docker compose build | ||||||||||
| docker compose create | ||||||||||
|
|
||||||||||
| # Run the production Docker container | ||||||||||
| run: | ||||||||||
| @docker rm -f $(CONTAINER_NAME) 2>/dev/null || true | ||||||||||
| docker run --name $(CONTAINER_NAME) -p $(HOST_PORT):$(CONTAINER_PORT) $(IMAGE_NAME):$(IMAGE_TAG) | ||||||||||
|
|
||||||||||
| # Build and run the development Docker container | ||||||||||
| run-dev: | ||||||||||
| docker compose up --build | ||||||||||
|
|
||||||||||
| # Start the development Docker container | ||||||||||
| start-dev: | ||||||||||
| docker compose start | ||||||||||
|
|
||||||||||
| # Build and run the production Docker container in one step | ||||||||||
| build-run: build run | ||||||||||
|
|
||||||||||
| # Stop the production Docker container | ||||||||||
| stop: | ||||||||||
| docker stop $(CONTAINER_NAME) | ||||||||||
|
Comment on lines
+57
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make Right now stop:
- docker stop $(CONTAINER_NAME)
+ docker stop $(CONTAINER_NAME) || true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| # Stop the development Docker container | ||||||||||
| stop-dev: | ||||||||||
| docker compose stop | ||||||||||
|
|
||||||||||
| # Clean the development Docker container | ||||||||||
| down-dev: | ||||||||||
| docker compose down | ||||||||||
|
|
||||||||||
| # Restart the production Docker container | ||||||||||
| restart: stop run | ||||||||||
|
|
||||||||||
| # Restart the development Docker container | ||||||||||
| restart-dev: | ||||||||||
| docker compose restart | ||||||||||
|
|
||||||||||
| # Show logs from the production Docker container | ||||||||||
| logs: | ||||||||||
| docker logs -f $(CONTAINER_NAME) | ||||||||||
|
|
||||||||||
| # Clean up by removing production Docker image and container | ||||||||||
| clean: | ||||||||||
| -docker rm -f $(CONTAINER_NAME) | ||||||||||
| -docker rmi $(IMAGE_NAME):$(IMAGE_TAG) | ||||||||||
|
|
||||||||||
| # Clean up by removing production Docker container | ||||||||||
| clean-container: | ||||||||||
| docker rm -f $(CONTAINER_NAME) | ||||||||||
|
|
||||||||||
| # Clean up by removing production Docker image and container | ||||||||||
| clean-image: | ||||||||||
| docker rmi $(IMAGE_NAME):$(IMAGE_TAG) | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent package manager usage.
The deps stage installs dependencies with pnpm (line 28), but the builder stage uses
npm run build(line 47). For consistency and to ensure the lockfile is respected, consider using pnpm throughout.Apply this diff to use pnpm for the build:
📝 Committable suggestion
🤖 Prompt for AI Agents