-
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.
infra: add docker-compose and docker container for every project
- Loading branch information
1 parent
7bc775b
commit eb6ae87
Showing
21 changed files
with
233 additions
and
57 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Stage 1: Base image for building | ||
FROM node:20-alpine AS base | ||
|
||
# Install pnpm globally | ||
RUN npm i -g pnpm | ||
|
||
# Create working directory | ||
WORKDIR /app | ||
|
||
# Copy root package files and workspace config | ||
COPY package.json pnpm-lock.yaml ./pnpm-workspace.yaml ./ | ||
|
||
# Copy source code for the backend | ||
COPY ./apps/backend ./apps/backend | ||
COPY ./prisma ./prisma | ||
COPY ./tsconfig.json ./tsconfig.json | ||
COPY ./libs ./libs | ||
COPY ./.env ./.env | ||
|
||
# # Install dependencies for all workspaces | ||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter @gym-mate/backend build:ts | ||
|
||
# # Stage 2: Final image for production | ||
# FROM node:20-alpine | ||
|
||
# # Create working directory | ||
# WORKDIR /app | ||
|
||
# # Copy files from the build stage | ||
# COPY --from=base /app/apps/backend /app | ||
# COPY --from=base /app/node_modules /node_modules | ||
# COPY --from=base /app/prisma /prisma | ||
# COPY --from=base /app/tsconfig.json /tsconfig.json | ||
# COPY --from=base /app/.env /.env | ||
# COPY --from=base /app/package.json /package.json | ||
|
||
# Expose port (if the backend uses port 3000) | ||
EXPOSE 3000 | ||
|
||
# WORKDIR /app/backend | ||
# Start the backend | ||
# CMD ["pnpm", "start:backend"] | ||
CMD ["sh", "-c", "pnpm prisma migrate deploy && pnpm start:backend"] |
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
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
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 @@ | ||
export { default as component } from "../../../../src/routes/auth/login/+page.svelte"; | ||
export { default as component } from "../../../../src/routes/auth/+page.svelte"; |
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 @@ | ||
export { default as component } from "../../../../src/routes/auth/signup/+page.svelte"; | ||
export { default as component } from "../../../../src/routes/auth/login/+page.svelte"; |
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 @@ | ||
export { default as component } from "../../../../src/routes/app/workout-programs/new/+page.svelte"; | ||
export { default as component } from "../../../../src/routes/app/workout-programs/[id]/+page.svelte"; |
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 @@ | ||
export { default as component } from "../../../../src/routes/auth/+page.svelte"; | ||
export { default as component } from "../../../../src/routes/app/workout-programs/new/+page.svelte"; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
18 changes: 18 additions & 0 deletions
18
apps/frontend/.svelte-kit/types/src/routes/app/workout-programs/[id]/$types.d.ts
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,18 @@ | ||
import type * as Kit from '@sveltejs/kit'; | ||
|
||
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; | ||
// @ts-ignore | ||
type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string; | ||
type RouteParams = { id: string }; | ||
type RouteId = '/app/workout-programs/[id]'; | ||
type MaybeWithVoid<T> = {} extends T ? T | void : T; | ||
export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; | ||
type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>> | ||
type EnsureDefined<T> = T extends null | undefined ? {} : T; | ||
type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never; | ||
export type Snapshot<T = any> = Kit.Snapshot<T>; | ||
type PageParentData = Omit<EnsureDefined<import('../../../$types.js').LayoutData>, keyof import('../../$types.js').LayoutData> & EnsureDefined<import('../../$types.js').LayoutData>; | ||
|
||
export type EntryGenerator = () => Promise<Array<RouteParams>> | Array<RouteParams>; | ||
export type PageServerData = null; | ||
export type PageData = Expand<PageParentData>; |
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,38 @@ | ||
# Stage 1: Base image for building | ||
FROM node:20-alpine AS base | ||
|
||
# Install pnpm globally | ||
RUN npm i -g pnpm | ||
|
||
# Create working directory | ||
WORKDIR /app | ||
|
||
# Copy root package files and workspace config | ||
COPY package.json pnpm-lock.yaml ./pnpm-workspace.yaml ./ | ||
|
||
# Copy source code for the bot | ||
COPY ./apps/telegram-bot ./apps/telegram-bot | ||
COPY ./prisma ./prisma | ||
COPY ./tsconfig.json ./tsconfig.json | ||
COPY ./libs ./libs | ||
COPY ./.env ./.env | ||
|
||
# Install dependencies for all workspaces | ||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter @gym-mate/telegram-bot build:ts | ||
|
||
# Stage 2: Final image for production | ||
FROM node:20-alpine | ||
|
||
# Create working directory | ||
WORKDIR /app | ||
|
||
# Copy files from the build stage | ||
COPY --from=base /app/apps/telegram-bot /app | ||
COPY --from=base /app/node_modules /node_modules | ||
COPY --from=base /app/prisma /prisma | ||
COPY --from=base /app/tsconfig.json /tsconfig.json | ||
COPY --from=base /app/.env /.env | ||
|
||
# Start the bot | ||
CMD ["npm", "start"] |
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
Oops, something went wrong.