button changes & attempts to make docker viable in the future
Some checks failed
ci / builder (push) Failing after 0s

This commit is contained in:
Kebo 2025-06-26 13:30:21 -05:00
parent a143106ade
commit a7b2713c0a
6 changed files with 43 additions and 68 deletions

View file

@ -10,15 +10,13 @@
}, },
"features": { "features": {
"ghcr.io/devcontainers/features/node:1": {}, "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 to add to the dev container. More info: https://containers.dev/features.
// "features": {}, // "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally. // 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. // Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release", // "postCreateCommand": "cat /etc/os-release",

View file

@ -7,7 +7,6 @@ on:
defaults: defaults:
run: run:
shell: bash
working-directory: /home/mom/git/eleboog-astro working-directory: /home/mom/git/eleboog-astro
jobs: jobs:

2
.gitignore vendored
View file

@ -17,6 +17,8 @@ pnpm-debug.log*
.env .env
.env.production .env.production
.pnpm-store
# macOS-specific files # macOS-specific files
.DS_Store .DS_Store

View file

@ -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. FROM node:23.11-slim AS base
# 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}
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable RUN corepack enable
################################################################################ WORKDIR /app
# Create a stage for installing production dependecies.
FROM base AS deps
# Download dependencies as a separate step to take advantage of Docker's caching. # By copying only the package.json and package-lock.json here, we ensure that the following `-deps` steps are independent of the source code.
# Leverage a cache mount to /root/.local/share/pnpm/store to speed up subsequent builds. # Therefore, the `-deps` steps will be skipped if only the source code changes.
# Leverage bind mounts to package.json and pnpm-lock.yaml to avoid having to copy them COPY package.json pnpm-lock.yaml ./
# 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
################################################################################ FROM base AS prod-deps
# Create a stage for building the application. RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM deps AS build
# Download additional development dependencies before building, as some projects require FROM base AS build-deps
# "devDependencies" to be installed to build. If you don't need this, remove this step. RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
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
# Copy the rest of the source files into the image. FROM build-deps AS build
COPY . . COPY . .
# Run the build script.
RUN pnpm run build RUN pnpm run build
################################################################################ FROM base AS runtime
# Create a new stage to run the application with minimal runtime dependencies # Copy dependencies
# where the necessary files are copied from the build stage. COPY --from=prod-deps /app/node_modules ./node_modules
FROM base AS final # Copy the built output
COPY --from=build /app/dist ./dist
# Use production node environment by default. # Bind to all interfaces
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.
ENV HOST=0.0.0.0 ENV HOST=0.0.0.0
# Port to listen on
ENV PORT=4321 ENV PORT=4321
# Just convention, not required
EXPOSE 4321 EXPOSE 4321
# Run the application. # Start the app
CMD pnpm start 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

@ -15,6 +15,7 @@ I thought about making a blogroll, but I decided instead to make a button galler
<a href="https://www.5snb.club"><img width="88" height="31" src="/buttons/522@5snb.club.png" class="border-none shadow-none inline rounded-none" alt="A button for 522 at 5snb dot club."/></a> <a href="https://www.5snb.club"><img width="88" height="31" src="/buttons/522@5snb.club.png" class="border-none shadow-none inline rounded-none" alt="A button for 522 at 5snb dot club."/></a>
<a href="https://foxscot.ch"><img width="88" height="31" src="/buttons/foxscot.ch.png" class="border-none shadow-none inline rounded-none" alt="A button for Foxscotch."/></a> <a href="https://foxscot.ch"><img width="88" height="31" src="/buttons/foxscot.ch.png" class="border-none shadow-none inline rounded-none" alt="A button for Foxscotch."/></a>
<a href="http://legacy.sominemo.com"><img width="88" height="31" src="/buttons/sominemo.gif" class="border-none shadow-none inline rounded-none" alt="A button for Sominemo."/></a> <a href="http://legacy.sominemo.com"><img width="88" height="31" src="/buttons/sominemo.gif" class="border-none shadow-none inline rounded-none" alt="A button for Sominemo."/></a>
<a href="https://bentley.trashcan.lol"><img width="88" height="31" src="/buttons/bentley_88x31.png" class="border-none shadow-none inline rounded-none" alt="A button for Bentley."/></a>
</div> </div>
{ false && <>...and here's a list of friends I am publicly shaming into making buttons because I am a gremlin: { false && <>...and here's a list of friends I am publicly shaming into making buttons because I am a gremlin: