updates distributed service

This commit is contained in:
Zheyuan Wu
2025-10-24 15:58:12 -05:00
parent d8096410af
commit 05d5b92255
12 changed files with 224 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
# Dockerfile for CSE folders
# Dockerfile for Math folders
# Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile
# syntax=docker.io/docker/dockerfile:1
@@ -28,10 +28,21 @@ FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN ls -la
# 2.1 Remove unnecessary files for build with title not starting with CSE
RUN find ./content -type d -not -name "CSE*" -exec rm -rf {} +
RUN find ./public -type f -not -name "*.md" -exec rm -rf {} +
# 2.1 Remove unnecessary files for build with title starting with CSE
RUN cd ./content && find . -maxdepth 1 -type d -name "Math*" -exec rm -rf {} +
RUN cd ./public && find . -maxdepth 1 -type d -name "Math*" -exec rm -rf {} +
# 2.1.1 Check the updated folders
RUN cd ./content && ls -la
RUN cd ./public && ls -la
# 2.2 Update the _meta.js files in the content folder
RUN sed -i '/\/\* Math Courses Start \*\//,/\/\* Math Courses End \*\//d' ./content/_meta.js
# 2.2.1 Check the updated _meta.js file
RUN cat ./content/_meta.js
# This will do the trick, use the corresponding env file for each environment.
# COPY .env.production.sample .env.production
@@ -55,8 +66,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
EXPOSE 4201
ENV PORT=3000
ENV PORT=4201
CMD HOSTNAME="0.0.0.0" node server.js

1
docker/cse/test-build.sh Normal file
View File

@@ -0,0 +1 @@
sudo docker build -t trance-0/notenextra-cse:v1.2.0 -f ./docker/cse/Dockerfile --no-cache --progress=plain .