Skip to content

Commit

Permalink
feat: dockerize api
Browse files Browse the repository at this point in the history
feat: dockerize api
  • Loading branch information
rajdip-b committed Jan 14, 2024
2 parents b103db6 + ee3bc19 commit ce8ee23
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t keyshade/keyshade-web:latest -f Dockerfile-web .
run: docker build -t keyshade/keyshade-web:latest -f ./apps/web/Dockerfile .

- name: Push Docker image
run: docker push keyshade/keyshade-web
Expand Down
1 change: 1 addition & 0 deletions apps/api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
19 changes: 19 additions & 0 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:20-alpine as build

WORKDIR /app

RUN npm i -g pnpm

COPY package.json .
COPY tsconfig.base.json .

RUN pnpm install

COPY apps/api apps/api

RUN pnpm run db:generate-types
RUN pnpm run build:api

EXPOSE 4200

ENTRYPOINT ["pnpm", "run", "start:api"]
1 change: 1 addition & 0 deletions apps/web/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"test:cli": "nx run cli:test",
"test:sdk-node": "nx run sdk-js:test",
"start:web": "nx run web:serve --configuration=production",
"start:api": "nx run api:serve --configuration=production",
"db:seed": "cd apps/api/src/prisma && pnpx ts-node seed.ts",
"db:generate-types": "nx run api:prisma:generate",
"db:generate-migrations": "cd apps/api/src/prisma && pnpx prisma migrate dev --create-only --skip-seed",
Expand Down

0 comments on commit ce8ee23

Please sign in to comment.