-
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.
Merge pull request #4 from Sivanwol/user_profile
User profile
- Loading branch information
Showing
175 changed files
with
7,192 additions
and
1,524 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,22 @@ | ||
.env | ||
|
||
dockerfile | ||
./**/*/dockerfile | ||
|
||
.dockerignore | ||
|
||
node_modules | ||
./**/*/node_modules | ||
|
||
pnpm-debug.log | ||
./**/*/pnpm-debug.log | ||
.next | ||
./**/*/.next | ||
dist | ||
./**/*/dist | ||
.turbo | ||
./**/*/.turbo | ||
.output | ||
./**/*/.output | ||
README.md | ||
.git |
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,4 @@ | ||
node-linker=hoisted | ||
strict-peer-dependencies=false | ||
save-workspace-protocol=false | ||
prefer-workspace-packages=true |
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,2 @@ | ||
**/*/next.config.cjs | ||
**/*/next.config.mjs |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.env | ||
|
||
Dockerfile | ||
./**/*/Dockerfile | ||
|
||
.dockerignore | ||
|
||
node_modules | ||
./**/*/node_modules | ||
|
||
pnpm-debug.log | ||
./**/*/pnpm-debug.log | ||
./**/*/dist | ||
|
||
README.md | ||
.next | ||
.git |
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,96 @@ | ||
FROM node:20-alpine AS base | ||
RUN apk add python3 make g++ gcc libc-dev linux-headers libc6-compat | ||
RUN npm install -g turbo | ||
RUN corepack enable | ||
RUN corepack prepare [email protected] --activate | ||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
RUN echo -e "\e[1;33mInstall globally packages for application backoffice\e[0m" | ||
COPY . . | ||
RUN turbo prune --scope=@app/backoffice --docker | ||
|
||
FROM base AS installer | ||
WORKDIR /app | ||
RUN echo -e "\e[1;33mWired environment variables for application backoffice\e[0m" | ||
ARG TURBO_TEAM | ||
ARG TURBO_TOKEN | ||
|
||
ENV TURBO_TEAM $TURBO_TEAM | ||
ENV TURBO_TOKEN $TURBO_TOKEN | ||
ENV CI true | ||
ENV SKIP_ENV_VALIDATION true | ||
|
||
# Set environment variables for application | ||
|
||
ARG POSTGRES_URL | ||
ARG BLOB_STORAGE_URL | ||
ARG BLOB_READ_WRITE_TOKEN | ||
ARG KV_URL | ||
ARG KV_REST_API_URL | ||
ARG BLOB_READ_WRITE_TOKEN | ||
ARG KV_REST_API_READ_ONLY_TOKEN | ||
ARG EDGE_CONFIG | ||
ARG AUTH_SECRET | ||
ARG NEXT_PUBLIC_AUTH_DESCOPE_ID | ||
ARG AUTH_DESCOPE_SECRET | ||
ARG AUTH_DESCOPE_ISSUER | ||
ARG AUTH_DESCOPE_MGT_KEY | ||
ARG AUTH_DESCOPE_MAIN_TENANT_ID | ||
ARG NEXT_PUBLIC_BETTER_LOGS_TOKEN | ||
|
||
ENV POSTGRES_URL ${POSTGRES_URL} | ||
ENV BLOB_STORAGE_URL ${BLOB_STORAGE_URL} | ||
ENV KV_URL ${KV_URL} | ||
ENV KV_REST_API_URL ${KV_REST_API_URL} | ||
ENV KV_REST_API_TOKEN ${KV_REST_API_TOKEN} | ||
ENV KV_REST_API_READ_ONLY_TOKEN ${KV_REST_API_READ_ONLY_TOKEN} | ||
ENV EDGE_CONFIG ${EDGE_CONFIG} | ||
ENV AUTH_SECRET ${AUTH_SECRET} | ||
ENV NEXT_PUBLIC_AUTH_DESCOPE_ID ${NEXT_PUBLIC_AUTH_DESCOPE_ID} | ||
ENV AUTH_DESCOPE_SECRET ${AUTH_DESCOPE_SECRET} | ||
ENV AUTH_DESCOPE_ISSUER ${AUTH_DESCOPE_ISSUER} | ||
ENV AUTH_DESCOPE_MGT_KEY ${AUTH_DESCOPE_MGT_KEY} | ||
ENV AUTH_DESCOPE_MAIN_TENANT_ID ${AUTH_DESCOPE_MAIN_TENANT_ID} | ||
ENV NEXT_PUBLIC_BETTER_LOGS_TOKEN ${NEXT_PUBLIC_BETTER_LOGS_TOKEN} | ||
|
||
RUN echo -e "\e[1;33mENVIRONMENT VARIABLES\e[0m"; | ||
# Create a .env file with all the environment variables but CI | ||
RUN env >> .env | ||
RUN cat .env | ||
|
||
RUN echo -e "\e[1;33mBuilding application backoffice\e[0m" | ||
# First install dependencies (as they change less often) | ||
COPY --from=builder /app/out/json . | ||
COPY --from=builder /app/out/pnpm-lock.yaml ./ | ||
COPY --from=builder /app/out/full . | ||
RUN pnpm install | ||
RUN pnpm build --filter=@app/backoffice | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
# Don't run production as root | ||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
USER nextjs | ||
# COPY --from=installer --chown=nextjs:nodejs /app/apps/backoffice/.next/standalone /app/apps/backoffice | ||
COPY --from=installer /app/apps/backoffice/next.config.mjs . | ||
COPY --from=installer /app/apps/backoffice/package.json . | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
|
||
COPY --from=installer --chown=nextjs:nodejs /app/apps/backoffice/.next ./ | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/backoffice/.next/standalone ./ | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/backoffice/.next/static ./standalone/apps/backoffice/.next/static | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/backoffice/public ./standalone/apps/backoffice/public | ||
COPY --from=installer /app/.env . | ||
RUN ls -la ./standalone/apps/backoffice | ||
|
||
RUN echo -e "\e[1;33mRunning application backoffice\e[0m" | ||
EXPOSE 3000 | ||
ENV PORT 3000 | ||
CMD ["sh", "-c", "node --experimental-modules ./standalone/apps/backoffice/server.js"] | ||
RUN echo -e "\e[1;33mApplication backoffice is running deployment done\e[0m" |
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,19 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: "backoffice", | ||
script: "npm", | ||
args: "run start:docker", | ||
env: { | ||
PORT: 3001, | ||
}, | ||
// Additional settings | ||
instances: 1, // Number of instances to run | ||
autorestart: true, // Automatically restart the app if it crashes | ||
watch: false, // Disable watching file changes | ||
max_restarts: 5, // Limit the number of restart attempts | ||
restart_delay: 1000, // Delay between restart attempts in milliseconds | ||
max_memory_restart: "300M", // Restart the app if it exceeds 300MB memory usage | ||
}, | ||
], | ||
}; |
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.