Refactor environment variables to use process.env in firebase configuration and update .gitignore for environment files
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -25,4 +25,8 @@ dist-ssr
|
||||
|
||||
# Pnpm lock files
|
||||
pnpm-lock.yaml
|
||||
pnpm-workspace.yaml
|
||||
pnpm-workspace.yaml
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
.env*
|
||||
@@ -1,12 +1,20 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
environment:
|
||||
apiKey: ${apiKey}
|
||||
authDomain: ${authDomain}
|
||||
projectId: ${projectId}
|
||||
storageBucket: ${storageBucket}
|
||||
messagingSenderId: ${messagingSenderId}
|
||||
appId: ${appId}
|
||||
measurementId: ${measurementId}
|
||||
ports:
|
||||
- "80"
|
||||
deploy:
|
||||
replicas: 3
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
rollback_config:
|
||||
parallelism: 1
|
||||
delay: 5s
|
||||
delay: 5s
|
||||
14
firebase.ts
14
firebase.ts
@@ -7,13 +7,13 @@ import { getFirestore } from "firebase/firestore";
|
||||
// Your web app's Firebase configuration
|
||||
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
|
||||
const firebaseConfig = {
|
||||
apiKey: "AIzaSyDjjh1mePjkVmSq6jSQLQ99bsqIPHuotLU",
|
||||
authDomain: "portfolio-ff4f6.firebaseapp.com",
|
||||
projectId: "portfolio-ff4f6",
|
||||
storageBucket: "portfolio-ff4f6.firebasestorage.app",
|
||||
messagingSenderId: "44240859214",
|
||||
appId: "1:44240859214:web:094f0ab145c1910cde931f",
|
||||
measurementId: "G-FLETQXV0G5"
|
||||
apiKey: process.env.apiKey,
|
||||
authDomain: process.env.authDomain,
|
||||
projectId: process.env.projectId,
|
||||
storageBucket: process.env.storageBucket,
|
||||
messagingSenderId: process.env.messagingSenderId,
|
||||
appId: process.env.appId,
|
||||
measurementId: process.env.measurementId
|
||||
};
|
||||
|
||||
// Initialize Firebase
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.25.0",
|
||||
"@tailwindcss/vite": "^4.1.10",
|
||||
"@types/node": "^25.0.3",
|
||||
"@types/react": "^19.1.2",
|
||||
"@types/react-dom": "^19.1.2",
|
||||
"@vitejs/plugin-react": "^4.5.2",
|
||||
|
||||
Reference in New Issue
Block a user