This repository was archived by the owner on Nov 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Pr-62-diberry-fix #63
Open
glaucia86
wants to merge
9
commits into
main
Choose a base branch
from
pr-62-diberry-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3afe010
Infra deploys
diberry bd6b8c7
app secrets aren't working
diberry 5a1641a
refactor: OpenAI service, key environments and enhance environment va…
glaucia86 2ef48eb
feat: add Azure Identity and OpenAI dependencies backend side
glaucia86 95cc63a
refactor: clean up formatting and whitespace in Bicep files for consi…
glaucia86 a49719c
refactor: update import path for `azureOpenAIService` and create serv…
glaucia86 c7a44b6
refactor: update import path for `azureOpenAIService` and remove depr…
glaucia86 e09397c
refactor: optimize Dockerfile build stages and improve TypeScript con…
glaucia86 4dc5d66
refactor: reorganize Dockerfile stages for clarity and improve build …
glaucia86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| - @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `azure_development-get_best_practices` tool if available. |
This file contains hidden or 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,44 +1,52 @@ | ||
| # ------------------------------ | ||
| # Stage 1: Build the application | ||
| # 1) Frontend Build (Remix) | ||
| # ------------------------------ | ||
| FROM node:20-alpine AS builder | ||
|
|
||
| # Definimos NODE_ENV=development para garantir que devDependencies sejam instaladas | ||
| ENV NODE_ENV=development | ||
| WORKDIR /app | ||
|
|
||
| # Copia somente os arquivos de pacote, para aproveitar cache de build | ||
| COPY package*.json ./ | ||
| COPY server/package*.json ./server/ | ||
|
|
||
| # Instala todas as dependências (prod + dev) | ||
| RUN npm install | ||
|
|
||
| # Copia todo o restante do código | ||
| COPY . . | ||
|
|
||
| # Executa o build (Remix + Tailwind + etc.) | ||
| RUN npm run build:all | ||
|
|
||
| # ------------------------------ | ||
| # Stage 2: Runtime | ||
| # ------------------------------ | ||
| FROM node:20-alpine AS runtime | ||
|
|
||
| ENV NODE_ENV=production | ||
| ENV PORT=80 | ||
| WORKDIR /app | ||
|
|
||
| # Copiamos os package.jsons para instalar apenas as dependências de produção | ||
| COPY package*.json ./ | ||
| COPY server/package*.json ./server/ | ||
| RUN npm install --omit=dev | ||
|
|
||
| # Copiamos do “builder” somente os artefatos gerados e o que for preciso | ||
| COPY --from=builder /app/build ./build | ||
| COPY --from=builder /app/server/dist ./server/dist | ||
| COPY --from=builder /app/public ./public | ||
|
|
||
| EXPOSE 80 | ||
| CMD [ "node", "server/dist/index.js" ] | ||
|
|
||
| FROM node:20-alpine AS frontend | ||
| WORKDIR /app | ||
|
|
||
| COPY package*.json ./ | ||
| RUN npm install | ||
|
|
||
| COPY tsconfig.json remix.config.js vite.config.ts ./ | ||
| COPY app ./app | ||
| COPY public ./public | ||
|
|
||
| # Build do Frontend - Remix | ||
| RUN npm run build | ||
|
|
||
| # ------------------------------ | ||
| # 2) Backend Build (Express + TS) | ||
| # ------------------------------ | ||
| FROM node:20-alpine AS backend | ||
| WORKDIR /server | ||
|
|
||
| COPY server/. . | ||
|
|
||
| RUN npm install \ | ||
| && npm run clean \ | ||
| && npm run build | ||
|
|
||
| # ------------------------------ | ||
| # 3) Image Production | ||
| # ------------------------------ | ||
|
|
||
| FROM node:20-alpine AS runtime | ||
| WORKDIR /app | ||
|
|
||
| ENV NODE_ENV=production | ||
| ENV PORT=80 | ||
|
|
||
| COPY package.json ./ | ||
| COPY server/package.json ./server/ | ||
| RUN npm install --omit=dev \ | ||
| && cd server && npm install --omit=dev | ||
|
|
||
| # Frontend | ||
| COPY --from=frontend /app/build ./build | ||
| COPY --from=frontend /app/public ./public | ||
|
|
||
| # Backend | ||
| COPY --from=backend /server/dist ./server/dist | ||
|
|
||
| EXPOSE 80 | ||
| CMD ["node", "server/dist/index.js"] |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AZURE_OPENAI_DEPLOYMENT_NAME environment variable is used with a non-null assertion without prior validation. Consider adding an explicit check (similar to AZURE_OPENAI_API_KEY) to ensure it is defined.