From f37688f2d196bfbb67ee9b15073540463ed812c9 Mon Sep 17 00:00:00 2001 From: Timothy Pidashev Date: Mon, 13 Jan 2025 08:43:07 -0800 Subject: [PATCH] hotfix --- .caddy/{Caddyfile.release => Caddyfile} | 2 +- .docker/Dockerfile.release | 26 ++++++++++++++----------- src/src/content/projects/darkbox.mdx | 2 +- src/src/pages/about.astro | 2 +- src/src/pages/blog/index.astro | 2 +- src/src/pages/resume.astro | 2 +- 6 files changed, 20 insertions(+), 16 deletions(-) rename .caddy/{Caddyfile.release => Caddyfile} (63%) diff --git a/.caddy/Caddyfile.release b/.caddy/Caddyfile similarity index 63% rename from .caddy/Caddyfile.release rename to .caddy/Caddyfile index 93d06a8..9f96e74 100644 --- a/.caddy/Caddyfile.release +++ b/.caddy/Caddyfile @@ -1,5 +1,5 @@ timmypidashev.dev { tls pidashev.tim@gmail.com - reverse_proxy web:4321 + reverse_proxy 127.0.0.1:3000 } diff --git a/.docker/Dockerfile.release b/.docker/Dockerfile.release index 47125b8..80d6c78 100644 --- a/.docker/Dockerfile.release +++ b/.docker/Dockerfile.release @@ -1,6 +1,5 @@ # Stage 1: Build and install dependencies FROM node:22-alpine AS builder - WORKDIR /app # Install necessary dependencies, including pnpm @@ -8,9 +7,15 @@ RUN set -eux \ && apk add --no-cache nodejs curl \ && npm install -g pnpm -# Copy package files +# Copy package files first (for better caching) COPY package.json pnpm-lock.yaml ./ +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Now copy the rest of your source code +COPY . . + # Set build arguments ARG CONTAINER_WEB_VERSION ARG ENVIRONMENT @@ -23,19 +28,18 @@ RUN echo "PUBLIC_VERSION=${CONTAINER_WEB_VERSION}" > /app/.env && \ echo "PUBLIC_BUILD_DATE=${BUILD_DATE}" >> /app/.env && \ echo "PUBLIC_GIT_COMMIT=${GIT_COMMIT}" >> /app/.env -# Install dependencies (including development dependencies) and build the project -RUN pnpm install --frozen-lockfile && pnpm run build +# Build the project +RUN pnpm run build -# Stage 2: Set up the production environment +# Stage 2: Serve static files FROM node:22-alpine - WORKDIR /app -# Expose the port for the application -EXPOSE 3000 +# Install serve +RUN npm install -g serve -# Copy the build artifacts from the builder stage +# Copy built files COPY --from=builder /app/dist ./dist -# Set the command to run the application -CMD ["node", "./dist/server/entry.mjs"] +EXPOSE 3000 +CMD ["serve", "-s", "dist", "-l", "3000"] diff --git a/src/src/content/projects/darkbox.mdx b/src/src/content/projects/darkbox.mdx index 30401cf..c72b3de 100644 --- a/src/src/content/projects/darkbox.mdx +++ b/src/src/content/projects/darkbox.mdx @@ -1,7 +1,7 @@ --- title: "Darkbox" description: "My gruvbox theme, with a pure black background" -githubUrl: "https://github.com/timmypidashev/web" +githubUrl: "https://github.com/timmypidashev/darkbox.nvim" techStack: ["Neovim", "Lua"] date: "2025-01-05" image: "/projects/darkbox/thumbnail.jpeg" diff --git a/src/src/pages/about.astro b/src/src/pages/about.astro index ff23c13..b36bb7b 100644 --- a/src/src/pages/about.astro +++ b/src/src/pages/about.astro @@ -6,7 +6,7 @@ import Timeline from "@/components/about/timeline"; import CurrentFocus from "@/components/about/current-focus"; import OutsideCoding from "@/components/about/outside-coding"; --- - +
diff --git a/src/src/pages/blog/index.astro b/src/src/pages/blog/index.astro index 57dd527..10a63aa 100644 --- a/src/src/pages/blog/index.astro +++ b/src/src/pages/blog/index.astro @@ -11,6 +11,6 @@ const posts = (await getCollection("blog", ({ data }) => { ); --- - + diff --git a/src/src/pages/resume.astro b/src/src/pages/resume.astro index 465c318..68c549b 100644 --- a/src/src/pages/resume.astro +++ b/src/src/pages/resume.astro @@ -5,7 +5,7 @@ import ContentLayout from "@/layouts/content.astro"; import Resume from "@/components/resume"; --- - +