Skip to content

Commit

Permalink
337th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Jun 6, 2024
1 parent 0532d15 commit 435ad22
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
run: docker compose exec --no-TTY ci pnpm build
- name: pnpm preview
run: docker compose exec --detach --no-TTY ci pnpm preview
- name: pnpm lint
run: docker compose exec --no-TTY ci pnpm lint
- name: pnpm check
run: docker compose exec --no-TTY ci pnpm check
- name: pnpm test
Expand Down
31 changes: 31 additions & 0 deletions infra/worker.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:20 as base

WORKDIR /usr/src/app
ADD . .

ARG REDIS_URL
ENV REDIS_URL=$REDIS_URL

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
RUN corepack use pnpm@9

RUN pnpm build

FROM node:20

WORKDIR /usr/src/app

COPY --from=base /usr/src/app/app/package.json /usr/src/app/package.json
COPY --from=base /usr/src/app/app/dist /usr/src/app/dist

ENV NODE_ENV=production

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
RUN corepack use pnpm@9

USER node
CMD [ "node", "/usr/src/app/dist/worker.js" ]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mock": "pnpm -C mock mock",
"build": "pnpm -C app build",
"preview": "pnpm -C app preview",
"lint": "biome check --apply ./",
"lint": "biome check --write ./",
"check": "pnpm -C app check",
"test": "pnpm -C app test",
"e2e": "pnpm -C e2e e2e"
Expand Down
21 changes: 7 additions & 14 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ services:
dockerfilePath: ./infra/Dockerfile

envVars:
- key: NODE_VERSION
value: 20.12.2
- key: HOST
value: 0.0.0.0
- key: PORT
value: 10000
- key: SITE_URL
sync: false
- key: MONGODB_URL
Expand All @@ -29,16 +23,15 @@ services:
- key: SECRET_KEY
generateValue: true

# - type: worker
# name: fastify-starter-queue
# runtime: node
# region: oregon
# - name: fastify-starter-worker
# type: worker
# runtime: docker
# plan: starter
# region: oregon
# branch: main

# dockerfilePath: ./infra/worker.Dockerfile

# envVars:
# - key: NODE_VERSION
# value: 20.12.2
# - key: REDIS_URL
# sync: false
# buildCommand: pnpm install; pnpm build
# startCommand: node app/dist/worker.js

0 comments on commit 435ad22

Please sign in to comment.