-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: ajust compose and env.example (#173) * fix: ajust compose and env.example * feat: insert new base workflows * fix: ajust docker compose and dockerfile * chore: remove db url from .env.example * feat: add new connection with mongo * feat: ajust mongo shemas and add integrate with prisma * fix: ajust husky to run prettier on files * fix: run pnpm in docker-compose * chore: ajust env.example * chore: add comando to push tables to mongo * chore: remove teste.js * fix: ajust stript push db --------- Co-authored-by: Paulo Victor <pilutechinformatica@gmail.com>
- Loading branch information
Showing
18 changed files
with
96 additions
and
188 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
HOSTNAME='localhost' | ||
PORT=3000 | ||
SECRET_KEY='321' | ||
DATABASE_URL="postgresql://postgres:password@localhost:5432/octopost" | ||
|
||
MONGO_CONTAINER_PORT="27017" | ||
|
||
DATABASE_URL="mongodb://localhost:27017/octopost" | ||
|
||
MONGO_INITDB_ROOT_USERNAME | ||
MONGO_INITDB_ROOT_PASSWORD | ||
ME_CONFIG_MONGODB_ADMINUSERNAME | ||
ME_CONFIG_MONGODB_ADMINPASSWORD | ||
ME_CONFIG_MONGODB_URL |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Base Actions | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
pull_request: | ||
|
||
jobs: | ||
assignes: | ||
uses: devhatt/workflows/.github/workflows/auto-assign.yml@main | ||
secrets: inherit |
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm prisma:generate | ||
pnpm format:fix | ||
pnpm test | ||
pnpm build |
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,25 +1,39 @@ | ||
FROM node:22 AS build | ||
FROM node:22 AS base | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN npm install -g pnpm@8 | ||
RUN corepack enable && corepack prepare pnpm@8.6.0 --activate | ||
|
||
COPY ./package.json ./pnpm-lock.yaml ./ | ||
|
||
COPY ./ . | ||
|
||
RUN pnpm install --frozen-lockfile -r | ||
FROM base AS prod-deps | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
|
||
FROM base AS build | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN npx prisma generate | ||
RUN pnpm build | ||
|
||
FROM node:22-alpine3.19 | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
|
||
RUN corepack enable && corepack prepare pnpm@8.6.0 --activate | ||
|
||
|
||
WORKDIR /usr/src/app | ||
RUN npm install -g pnpm@8 | ||
COPY --from=build /usr/src/app/package.json ./package.json | ||
COPY --from=build /usr/src/app/build ./build | ||
COPY --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --from=prod-deps /usr/src/app/node_modules ./node_modules | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["pnpm", "run", "start"] | ||
CMD ["pnpm", "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
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,12 @@ | ||
ARG MONGO_VERSION | ||
|
||
FROM mongo:${MONGO_VERSION} | ||
|
||
# we take over the default & start mongo in replica set mode in a background task | ||
ENTRYPOINT mongod --port $MONGO_REPLICA_PORT --replSet rs0 --bind_ip 0.0.0.0 & MONGOD_PID=$!; \ | ||
# we prepare the replica set with a single node and prepare the root user config | ||
INIT_REPL_CMD="rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: '$MONGO_REPLICA_HOST:$MONGO_REPLICA_PORT' }] })"; \ | ||
# we wait for the replica set to be ready and then submit the command just above | ||
until ($MONGO_COMMAND admin --port $MONGO_REPLICA_PORT --eval "$INIT_REPL_CMD"); do sleep 1; done; \ | ||
# we are done but we keep the container by waiting on signals from the mongo task | ||
echo "REPLICA SET ONLINE"; wait $MONGOD_PID; |
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 was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
prisma/migrations/20240513235110_add_default_value_in_update_at_account/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
prisma/migrations/20240605201015_add_is_active_to_user/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
prisma/migrations/20240719232325_add_new_columns_in_account/migration.sql
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
prisma/migrations/20240722010704_rename_columns/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* istanbul ignore file -- @preserve */ | ||
|
||
import { app } from '@/config/app'; | ||
import { env } from '@/config/env'; | ||
|
||
|
Oops, something went wrong.