-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: improve building and resulting code
- Loading branch information
1 parent
4e1163c
commit d7641ec
Showing
7 changed files
with
162 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,7 @@ dist | |
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# yarn v4 | ||
.yarn/* | ||
!.yarn/releases | ||
!.yarn/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
FROM node:alpine AS builder | ||
FROM node:22-alpine AS base | ||
ENV NODE_ENV=development | ||
ENV YARN_VERSION=4.5.1 | ||
RUN corepack enable && corepack prepare yarn@${YARN_VERSION} | ||
RUN apk add git | ||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
COPY package.json yarn.lock .yarnrc.yml ./ | ||
# COPY .yarn ./.yarn | ||
RUN yarn install --immutable | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN apk add --no-cache git | ||
RUN yarn install --frozen-lockfile | ||
COPY ./src ./src | ||
COPY ./tsconfig.json ./ | ||
|
||
RUN yarn build | ||
|
||
FROM node:alpine | ||
FROM node:alpine AS runner | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY package.json yarn.lock ./ | ||
COPY . . | ||
|
||
COPY --from=builder /app/dist ./dist | ||
COPY ./cronjob /etc/crontabs/root | ||
RUN touch /var/log/cron.log | ||
|
||
CMD ["sh", "-c", "crond && tail -f /dev/null"] | ||
CMD ["sh", "-c", "crond && tail -f /var/log/cron.log"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0 * * * * yarn start >> /var/log/cron.log 2>&1 | ||
0 * * * * node /app/dist/src/index.js >> /var/log/cron.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import { config } from 'dotenv'; | ||
config(); | ||
|
||
import Mailer from './mailer'; | ||
import Planka from './planka'; | ||
|
||
|
Oops, something went wrong.