diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2dae48e..d716608 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,15 +10,13 @@ }, "features": { "ghcr.io/devcontainers/features/node:1": {}, - "ghcr.io/astronomer/devcontainer-features/astro-cli:1": {}, - "ghcr.io/cirolosapio/devcontainers-features/alpine-git:0": {} - } + }, // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + "forwardPorts": [4321] // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "cat /etc/os-release", diff --git a/.forgejo/workflows/docker-build.yaml b/.forgejo/workflows/docker-build.yaml index eca9812..35a4d9e 100644 --- a/.forgejo/workflows/docker-build.yaml +++ b/.forgejo/workflows/docker-build.yaml @@ -7,7 +7,6 @@ on: defaults: run: - shell: bash working-directory: /home/mom/git/eleboog-astro jobs: diff --git a/.gitignore b/.gitignore index 16d54bb..810079b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ pnpm-debug.log* .env .env.production +.pnpm-store + # macOS-specific files .DS_Store diff --git a/Dockerfile b/Dockerfile index 6a49a1a..f5b1738 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,79 +1,54 @@ -# syntax=docker/dockerfile:1 +# okay, let's figure this out -# Comments are provided throughout this file to help you get started. -# If you need more help, visit the Dockerfile reference guide at -# https://docs.docker.com/go/dockerfile-reference/ - -# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 - -ARG NODE_VERSION=23.3.0 -ARG PNPM_VERSION=9.10.0 - -################################################################################ -# Use node image for base image for all stages. -FROM node:${NODE_VERSION}-alpine AS base - -# Set working directory for all build stages. -WORKDIR /usr/src/app - -# Install pnpm. -RUN --mount=type=cache,target=/root/.npm \ - npm install -g pnpm@${PNPM_VERSION} +FROM node:23.11-slim AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable -################################################################################ -# Create a stage for installing production dependecies. -FROM base AS deps +WORKDIR /app -# Download dependencies as a separate step to take advantage of Docker's caching. -# Leverage a cache mount to /root/.local/share/pnpm/store to speed up subsequent builds. -# Leverage bind mounts to package.json and pnpm-lock.yaml to avoid having to copy them -# into this layer. -RUN --mount=type=bind,source=package.json,target=package.json \ - --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ - --mount=type=cache,target=/root/.local/share/pnpm/store \ - pnpm install --prod --frozen-lockfile +# By copying only the package.json and package-lock.json here, we ensure that the following `-deps` steps are independent of the source code. +# Therefore, the `-deps` steps will be skipped if only the source code changes. +COPY package.json pnpm-lock.yaml ./ -################################################################################ -# Create a stage for building the application. -FROM deps AS build +FROM base AS prod-deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile -# Download additional development dependencies before building, as some projects require -# "devDependencies" to be installed to build. If you don't need this, remove this step. -RUN --mount=type=bind,source=package.json,target=package.json \ - --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ - --mount=type=cache,target=/root/.local/share/pnpm/store \ - pnpm install --frozen-lockfile +FROM base AS build-deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile -# Copy the rest of the source files into the image. +FROM build-deps AS build COPY . . -# Run the build script. RUN pnpm run build -################################################################################ -# Create a new stage to run the application with minimal runtime dependencies -# where the necessary files are copied from the build stage. -FROM base AS final +FROM base AS runtime +# Copy dependencies +COPY --from=prod-deps /app/node_modules ./node_modules +# Copy the built output +COPY --from=build /app/dist ./dist -# Use production node environment by default. -ENV NODE_ENV=production - -# Run the application as a non-root user. -USER node - -# Copy package.json so that package manager commands can be used. -COPY package.json . - -# Copy the production dependencies from the deps stage and also -# the built application from the build stage into the image. -COPY --from=deps /usr/src/app/node_modules ./node_modules -COPY --from=build /usr/src/app/dist ./dist - -# Expose the port that the application listens on. +# Bind to all interfaces ENV HOST=0.0.0.0 +# Port to listen on ENV PORT=4321 +# Just convention, not required EXPOSE 4321 -# Run the application. -CMD pnpm start +# Start the app +CMD ["node", "./dist/server/entry.mjs"] + +# Install NGINX +RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* + +# Copy NGINX config +COPY nginx.conf /etc/nginx/nginx.conf + +# Serve static files from /app/dist/client +RUN mkdir -p /var/www/html && ln -s /app/dist/client /var/www/html + +# Expose NGINX port +EXPOSE 8080 + +# Start both NGINX and Node server +CMD service nginx start && node ./dist/server/entry.mjs \ No newline at end of file diff --git a/public/buttons/bentley_88x31.png b/public/buttons/bentley_88x31.png new file mode 100644 index 0000000..10c195e Binary files /dev/null and b/public/buttons/bentley_88x31.png differ diff --git a/src/pages/cool.mdx b/src/pages/cool.mdx index f8c67c7..762c4bd 100644 --- a/src/pages/cool.mdx +++ b/src/pages/cool.mdx @@ -15,6 +15,7 @@ I thought about making a blogroll, but I decided instead to make a button galler A button for 522 at 5snb dot club. A button for Foxscotch. A button for Sominemo. +A button for Bentley. { false && <>...and here's a list of friends I am publicly shaming into making buttons because I am a gremlin: