button changes & attempts to make docker viable in the future
Some checks failed
ci / builder (push) Failing after 0s
Some checks failed
ci / builder (push) Failing after 0s
This commit is contained in:
parent
a143106ade
commit
a7b2713c0a
6 changed files with 43 additions and 68 deletions
|
@ -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",
|
||||
|
|
|
@ -7,7 +7,6 @@ on:
|
|||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: /home/mom/git/eleboog-astro
|
||||
|
||||
jobs:
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,6 +17,8 @@ pnpm-debug.log*
|
|||
.env
|
||||
.env.production
|
||||
|
||||
.pnpm-store
|
||||
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
|
||||
|
|
101
Dockerfile
101
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
|
BIN
public/buttons/bentley_88x31.png
Normal file
BIN
public/buttons/bentley_88x31.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
|
@ -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://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="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>
|
||||
|
||||
{ false && <>...and here's a list of friends I am publicly shaming into making buttons because I am a gremlin:
|
||||
|
|
Loading…
Add table
Reference in a new issue