-
Notifications
You must be signed in to change notification settings - Fork 8
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 #52 from TylerOrtiz/feature/docker-compose-workflow
Feature/docker compose workflow
- Loading branch information
Showing
16 changed files
with
24,660 additions
and
5 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,3 @@ | ||
# None of these are necessary to change unless you want it to be different | ||
# GOOGLE_APPLICATION_CREDENTIALS=<your-google-credentials-file-path> | ||
# FIREBASE_CONFIG=<your-firebase-config-file-path> |
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,7 @@ | ||
{ | ||
"projects": { | ||
"c4btv": "baby-equipment-exchange" | ||
}, | ||
"targets": {}, | ||
"etags": {} | ||
} |
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 |
---|---|---|
|
@@ -55,3 +55,4 @@ serviceAccount.json | |
#VSCODE Preferences | ||
.vscode | ||
|
||
.env |
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,46 @@ | ||
# a Node.js base image that includes Node v18 | ||
FROM node:18-bullseye as base | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y jq default-jdk && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip && \ | ||
unzip chromedriver_linux64.zip && \ | ||
mv chromedriver /usr/bin/chromedriver && \ | ||
chmod +x /usr/bin/chromedriver && \ | ||
rm -f chromedriver_linux64.zip | ||
|
||
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ | ||
dpkg -i google-chrome-stable_current_amd64.deb || true && \ | ||
apt-get install -f -y && \ | ||
rm -f google-chrome-stable_current_amd64.deb | ||
|
||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome | ||
ENV FIREBASE_TOOLS_VERSION=13.5.1 | ||
|
||
RUN npm install -g firebase-tools@${FIREBASE_TOOLS_VERSION} && \ | ||
firebase experiments:enable webframeworks | ||
|
||
FROM base as firebase | ||
|
||
WORKDIR /usr/src/app | ||
|
||
FROM base as functions | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY functions/package*.json functions/ | ||
|
||
RUN cd functions && npm install | ||
|
||
FROM base as app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ENV CYPRESS_INSTALL_BINARY=0 | ||
|
||
COPY package*.json . | ||
|
||
RUN npm install |
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,52 @@ | ||
services: | ||
|
||
firebase: | ||
image: baby-equipment-exchange-firebase | ||
build: | ||
context: . | ||
target: firebase | ||
command: firebase emulators:start --only functions | ||
environment: | ||
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS:-service-account.json} | ||
- FIREBASE_CONFIG=${FIREBASE_CONFIG:-firebase-config.json} | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
- /usr/src/app/functions/node_modules | ||
ports: | ||
# https://firebase.google.com/docs/emulator-suite/install_and_configure#port_configuration | ||
- "4000:4000" # Emulator Suite UI | ||
- "5001:5001" # Cloud Functions | ||
|
||
functions: | ||
image: baby-equipment-exchange-functions | ||
build: | ||
context: . | ||
target: functions | ||
working_dir: /usr/src/app/functions | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
- /usr/src/app/functions/node_modules | ||
command: npm run build:watch | ||
environment: | ||
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS:-service-account.json} | ||
- FIREBASE_CONFIG=${FIREBASE_CONFIG:-firebase-config.json} | ||
- NODE_ENV=development | ||
depends_on: | ||
- firebase | ||
|
||
nextjs: | ||
image: baby-equipment-exchange-nextjs | ||
build: | ||
context: . | ||
target: app | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
- /usr/src/app/functions/node_modules | ||
ports: | ||
- "3000:3000" | ||
command: npm run alt-dev | ||
environment: | ||
- FIREBASE_CONFIG=${FIREBASE_CONFIG:-firebase-config.json} |
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,68 @@ | ||
{ | ||
"firestore": { | ||
"rules": "firestore.rules", | ||
"indexes": "firestore.indexes.json" | ||
}, | ||
"hosting": { | ||
"source": ".", | ||
"ignore": [ | ||
"firebase.json", | ||
"*/.", | ||
"*/node_modules/*" | ||
], | ||
"frameworksBackend": { | ||
"region": "us-east1", | ||
"maxInstances":10 | ||
} | ||
}, | ||
"storage": { | ||
"rules": "storage.rules" | ||
}, | ||
"functions": [ | ||
{ | ||
"source": "functions", | ||
"codebase": "default", | ||
"ignore": [ | ||
"node_modules", | ||
".git", | ||
"firebase-debug.log", | ||
"firebase-debug.*.log" | ||
], | ||
"predeploy": [ | ||
"npm --prefix \"$RESOURCE_DIR\" run build" | ||
] | ||
} | ||
], | ||
"emulators": { | ||
"auth": { | ||
"enabled": false, | ||
"host": "0.0.0.0", | ||
"port": 9099 | ||
}, | ||
"firestore": { | ||
"enabled": false, | ||
"host": "0.0.0.0", | ||
"port": 8080 | ||
}, | ||
"functions": { | ||
"enabled": true, | ||
"host": "0.0.0.0", | ||
"port": 5001 | ||
}, | ||
"hosting": { | ||
"enabled": true, | ||
"host": "0.0.0.0", | ||
"port": 5000 | ||
}, | ||
"storage": { | ||
"enabled": false, | ||
"host": "0.0.0.0", | ||
"port": 9199 | ||
}, | ||
"ui": { | ||
"enabled": true, | ||
"host": "0.0.0.0", | ||
"port": 4000 | ||
} | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"indexes": [], | ||
"fieldOverrides": [] | ||
} |
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,53 @@ | ||
rules_version = '2'; | ||
|
||
service cloud.firestore { | ||
match /databases/{database}/documents { | ||
// Administrator role | ||
match /Events/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /Donations/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /DonationDetails/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /Images/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /ImageDetails/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /Organizations/{document=**} { | ||
allow create, read, update, write: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /Storage/{document=**} { | ||
allow create, read, update, write: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /Users/{document=**} { | ||
allow read: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
match /UserDetails/{document=**} { | ||
allow read, update: if request.auth != null && request.auth.token.admin == true; | ||
} | ||
// Standard user role | ||
match /Donations/{document=**} { | ||
allow create, read, update, write: if request.auth != null; | ||
} | ||
match /DonationDetails/{document=**} { | ||
allow create, read, update, write: if request.auth != null; | ||
} | ||
match /Images/{document=**} { | ||
allow create, read: if request.auth != null; | ||
} | ||
match /ImageDetails/{document=**} { | ||
allow create, read: if request.auth != null; | ||
} | ||
match /Users/{userId} { | ||
allow create, read, update, write: if request.auth != null && request.auth.uid == userId; | ||
} | ||
match /UserDetails/{userId} { | ||
allow create, read, update, write: if request.auth != null && request.auth.uid == userId; | ||
} | ||
} | ||
} |
Oops, something went wrong.