Skip to content

Commit

Permalink
chore: fix build process and code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
SebassNoob committed Dec 3, 2023
1 parent 6b8d778 commit ca284f0
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 21 deletions.
Binary file modified interapp-backend/bun.lockb
Binary file not shown.
5 changes: 3 additions & 2 deletions interapp-backend/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install
RUN bun install --frozen-lockfile
ENV NODE_ENV development

EXPOSE 3000
CMD ["bun", "--watch", "api/routes/index.ts"]
5 changes: 3 additions & 2 deletions interapp-backend/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .
RUN bun install
RUN bun install --production --frozen-lockfile
ENV NODE_ENV production

EXPOSE 3000
CMD ["bun", "run", "api/routes/index.ts"]
8 changes: 5 additions & 3 deletions interapp-backend/scheduler/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install
RUN bun install --frozen-lockfile

RUN apt-get update && apt-get install -y tzdata
ENV TZ=Asia/Singapore
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
RUN apt-get clean

ENV NODE_ENV development
CMD ["bun", "--watch", "scheduler/scheduler.ts"]
9 changes: 5 additions & 4 deletions interapp-backend/scheduler/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install
RUN bun install --production --frozen-lockfile

RUN apt-get update && apt-get install -y tzdata
ENV TZ=Asia/Singapore
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
RUN apt-get clean

ENV NODE_ENV production
CMD ["bun", "run", "scheduler/scheduler.ts"]
4 changes: 2 additions & 2 deletions interapp-backend/tests/config/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install
RUN bun install --frozen-lockfile

EXPOSE 1234
CMD ["bun", "run", "api/routes/index.ts"]
2 changes: 1 addition & 1 deletion interapp-backend/tests/unit/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Unit (auth)', () => {
email: 'dskjfklsjf@jfndcdfs',
verified: false,
service_hours: 0,
permissions: expect.any(Array<Number>),
permissions: expect.any(Array<number>),
},
});
});
Expand Down
2 changes: 0 additions & 2 deletions interapp-backend/tests/unit/service.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { UserModel } from '@models/user';
import { AuthModel } from '@models/auth';
import { ServiceModel } from '@models/service';
import { describe, expect, test, afterAll, beforeAll } from 'bun:test';
import { recreateDB } from '../utils/recreate_db';
import appDataSource from '@utils/init_datasource';
import { AttendanceStatus } from '@db/entities';

describe('Unit (service)', () => {
Expand Down
Binary file modified interapp-frontend/bun.lockb
Binary file not shown.
6 changes: 4 additions & 2 deletions interapp-frontend/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install
ENV NODE_ENV development
RUN bun install --frozen-lockfile


EXPOSE 3000
CMD ["bun", "run", "dev"]
2 changes: 1 addition & 1 deletion interapp-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"eslint": "^8",
"eslint-config-next": "14.0.1",
"prettier": "^3.1.0",
"typescript": "^5"
"typescript": "^5.3.2"
}
}
6 changes: 4 additions & 2 deletions interapp-frontend/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM oven/bun:1.0.14
FROM oven/bun:1.0.15
WORKDIR /app

COPY . .

RUN bun install

ENV NODE_ENV production
RUN bun install --frozen-lockfile
RUN bun run build


EXPOSE 3000
CMD ["bun", "run", "start"]

0 comments on commit ca284f0

Please sign in to comment.