dockyfied dockyfied

This commit is contained in:
Robin Bärtschi 2025-02-13 17:18:47 +01:00
parent 47453b8a02
commit 6476d54164
6 changed files with 17 additions and 9 deletions

View File

@ -13,3 +13,4 @@ helm-charts
.editorconfig
.idea
coverage*
build

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
# deps
node_modules/
build/

View File

@ -21,18 +21,18 @@ 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/index.ts .
# COPY --from=install /temp/prod/node_modules node_modules
# COPY --from=prerelease /usr/src/app/index.ts .
COPY --from=prerelease /usr/src/app/package.json .
COPY --from=prerelease /usr/src/app/build/ .
COPY --from=prerelease /usr/src/app/static/ ./static
# run the app
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "index.ts" ]
EXPOSE 3000
ENTRYPOINT [ "bun", "run", "index.js" ]

5
docker-compose.yml Normal file
View File

@ -0,0 +1,5 @@
services:
dockyfied:
build: .
ports:
- "3000:3000"

View File

@ -1,7 +1,8 @@
{
"name": "dockyfied",
"scripts": {
"dev": "bun run --watch src/index.tsx"
"dev": "bun run --watch src/index.tsx",
"build": "bun build src/index.tsx --outdir ./build --splitting"
},
"dependencies": {
"hono": "^4.7.1"

View File

@ -4,7 +4,7 @@ import { logger } from 'hono/logger';
import BaseDocument from './BaseDocument';
function ImageButton() {
return <button hx-get='/image' hx-target='this' hx-swap="outerHTML">See Image</button>;
return <button hx-get='/image' hx-target='this' hx-swap="outerHTML">See Meme</button>;
}
const app = new Hono();
@ -31,7 +31,7 @@ app.get(
<p>&uarr;</p>
<p>Click the image above to replace with the button again.</p>
<br />
<p id='secret' hx-swap='outerHTML' hx-get='/image2'>Another image?</p>
<p id='secret' hx-swap='outerHTML' hx-get='/image2'>Another Meme?</p>
</div>
);
}