add Dockerfile

This commit is contained in:
Mike 2025-03-24 04:06:00 -04:00
parent 2dca50ff7a
commit ce35924a54
3 changed files with 47 additions and 1 deletions
keynotes.app

View file

@ -0,0 +1,15 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
coverage*

31
keynotes.app/Dockerfile Normal file
View file

@ -0,0 +1,31 @@
FROM oven/bun:1 AS base
WORKDIR /usr/src/app
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
# [optional] tests & build
ENV NODE_ENV=production
RUN bun test
RUN bun run build
# copy production dependencies and source code into final image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/app.js .
COPY --from=prerelease /usr/src/app/package.json .
# run the app
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "app.js" ]

View file

@ -417,7 +417,7 @@ footer {
background: var(--100-blue);
border: 2px solid black;
width: 100%;
max-width: 150px;
/*max-width: 150px;*/
border-radius: var(--border-radius-sm);
z-index: 1;
}