Dockerized application
Unit Tests with docker compose / unit-test (push) Successful in 32s Details
Build image / build (push) Successful in 53s Details

This commit is contained in:
Sugui 2024-04-20 12:09:07 +02:00
parent 642e075721
commit 9ffbe715b6
5 changed files with 21 additions and 8 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM oven/bun:1
WORKDIR /usr/src/app
COPY src/ src/
COPY bun.lockb .
COPY package.json .
COPY tsconfig.json .
RUN bun install --production --frozen-lockfile
EXPOSE 8081/tcp
ENTRYPOINT [ "/bin/bash", "-c" ]
CMD ["bun run src/index.ts"]

7
Dockerfile.dev Normal file
View File

@ -0,0 +1,7 @@
FROM oven/bun:1
WORKDIR /usr/src/app
COPY . .
RUN bun install
EXPOSE 8081/tcp
ENTRYPOINT [ "/bin/bash", "-c" ]
CMD ["bun --hot run src/index.ts"]

BIN
bun.lockb

Binary file not shown.

View File

@ -26,11 +26,9 @@ services:
JWTSECRET: "cooljwtsecret"
fe-middleware:
image: oven/bun:1
build:
dockerfile: Dockerfile.dev
container_name: fe-middleware
entrypoint: /bin/bash -c
command: ["bun --hot run src/index.ts"]
working_dir: /usr/src/app
ports:
- "8081:8081"
depends_on:
@ -40,8 +38,6 @@ services:
BOT_API_URI: "http://bot-api:8080"
GELBOORU_IMAGES_PER_REQUEST: 100 # Number of images per request, maximum 100
GELBOORU_TAGS: "2girls sleeping" # Tags of the images. The images will have all of these tags
volumes:
- ./:/usr/src/app:ro
volumes:
mongodb_data:

View File

@ -21,7 +21,7 @@
},
"scripts": {
"start": "bun run src/index.ts",
"dev": "docker compose down -v && docker compose up",
"test": "docker compose down -v && docker compose run fe-middleware 'sleep 5 && bun test'"
"dev": "docker compose down -v && docker compose up --build",
"test": "docker compose down -v && docker compose run --build fe-middleware 'pwd && ls && sleep 5 && bun test'"
}
}