Skip to content

Commit

Permalink
Merge pull request #12 from typekpb/docker
Browse files Browse the repository at this point in the history
adding docker
  • Loading branch information
Glowstudent777 authored Dec 30, 2024
2 parents 98eced0 + 5cded51 commit 5da0c7f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish Docker
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: Glowstudent777/youversion-api
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
default_branch: main
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:23-alpine AS builder

WORKDIR /app

RUN npm install -g pnpm

COPY package.json pnpm-lock.yaml ./

RUN pnpm install

COPY . .

RUN pnpm run build


FROM node:23-alpine AS runtime

WORKDIR /app

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml

RUN npm install -g pnpm && pnpm install --prod

EXPOSE 3000

CMD ["node", "dist/index.js"]
6 changes: 3 additions & 3 deletions src/swagger/swaggerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const swaggerOptions: swaggerJSDoc.Options = {
}
},
apis: [
"./src/api/v1/verse/*.ts",
"./src/api/v1/votd/*.ts",
"./src/api/v1/status.ts"
"./dist/api/v1/verse/*.js",
"./dist/api/v1/votd/*.js",
"./dist/api/v1/status.js"
]
};

0 comments on commit 5da0c7f

Please sign in to comment.