diff --git a/.dockerignore b/.dockerignore index f965aed..eed8057 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,3 +13,4 @@ helm-charts .editorconfig .idea coverage* +build diff --git a/.gitignore b/.gitignore index 506e4c3..1fabdf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # deps node_modules/ +build/ diff --git a/Dockerfile b/Dockerfile index 2e7791e..4a697ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e314083 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + dockyfied: + build: . + ports: + - "3000:3000" diff --git a/package.json b/package.json index 3d213ed..b17c406 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/index.tsx b/src/index.tsx index 259f8ff..afb7dac 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,7 +4,7 @@ import { logger } from 'hono/logger'; import BaseDocument from './BaseDocument'; function ImageButton() { - return ; + return ; } const app = new Hono(); @@ -31,7 +31,7 @@ app.get(

Click the image above to replace with the button again.


-

Another image?

+

Another Meme?

); }