diff --git a/.gitea/workflows/docker-publish.yaml b/.gitea/workflows/docker-publish.yaml index 47e71bc8..40cd0091 100644 --- a/.gitea/workflows/docker-publish.yaml +++ b/.gitea/workflows/docker-publish.yaml @@ -38,19 +38,25 @@ jobs: env-slug: ${{ steps.env_config.outputs.INFISICAL_ENV }} project-slug: "syscom-xpq-0" domain: "https://infisical.biz360.me/" - export-type: "file" - file-output-path: "/infisical.env" + # export-type: "file" + # file-output-path: "/infisical.env" + + # - name: Brute-force overwrite environment.ts + # run: | + # source infisical.env + + # # Forcefully overwrite the file the developers are importing + # echo "${!PROJECT_SECRET_KEY}" > "$ENV_FILE_PATH" + + # # Clean up + # rm -f infisical.env - name: Brute-force overwrite environment.ts run: | - source infisical.env - - # Forcefully overwrite the file the developers are importing + # Because the secret is now a native environment variable, we can write it directly. + # The double quotes around the indirect expansion preserve all newlines and internal single quotes! echo "${!PROJECT_SECRET_KEY}" > "$ENV_FILE_PATH" - # Clean up - rm -f infisical.env - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -67,7 +73,6 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,event=branch type=raw,value=dev-{{date 'YYYYMMDDTHHmm'}},enable=${{ github.ref == 'refs/heads/dev' }} type=raw,value=prod-{{date 'YYYYMMDDTHHmm'}},enable=${{ github.ref == 'refs/heads/prod' }} @@ -75,7 +80,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./docker/Dockerfile + file: Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index efe8002c..e8c7cc34 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,5 @@ Thumbs.db eslint.config.js # Ignore preview folder -preview/ \ No newline at end of file +preview/ +/.vs diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fd279028 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# ----- Stage 1: Build Angular App ----- +FROM node:22-alpine AS build +WORKDIR /app + +# Copy package files +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm ci + +# Copy the rest of the code +COPY . . + +# Build the Angular app for production +RUN npm run build + +# ----- Stage 2: Serve Angular App with Nginx ----- +FROM nginx:alpine + +# Copy the built assets from the build stage into Nginx's default HTML folder +COPY --from=build /app/preview /usr/share/nginx/html + +# Expose standard HTTP port 80 +EXPOSE 80 + +# Start Nginx in the foreground +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index bfa4810c..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# ----- Stage 1: Build Angular SSR App ----- -FROM node:22-alpine AS build -WORKDIR /app - -# Copy package files -COPY package.json package-lock.json ./ - -# Install dependencies -RUN npm ci - -# Copy the rest of the code (including the environment.ts injected by Gitea Actions) -COPY . . - -# Build the Angular app for production -RUN npm run build - -# ----- Stage 2: Serve SSR App ----- -FROM node:22-alpine AS final - -WORKDIR /app - -# Copy the built assets from the build stage. -COPY --from=build /app/preview ./preview - -# Expose the standard Angular SSR port -EXPOSE 4000 - -# Start the Node.js SSR server -CMD ["node", "preview/server/server.mjs"] \ No newline at end of file diff --git a/src/app/app.config.ts b/src/app/app.config.ts index db2874ef..b26bebc6 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -26,7 +26,7 @@ export const appConfig: ApplicationConfig = { AngularFireModule, provideCharts(withDefaultRegisterables()), importProvidersFrom( - AngularFireModule.initializeApp(environment.firebase), + // AngularFireModule.initializeApp(environment.firebase), ToastrModule.forRoot({ timeOut: 1500, closeButton: true, diff --git a/tsconfig.spec.json b/tsconfig.spec.json index d3837063..51f91869 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -4,6 +4,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", + "rootDir": "src", "types": [ "vitest/globals" ]