Skip to content

Commit

Permalink
Merge pull request #145 from Code-Hammers/CHE-193/subtask/Create-and-…
Browse files Browse the repository at this point in the history
…Seed-Mongo-Container-for-Dev

[CHE-193] Create and Seed Mongo Container for Dev
  • Loading branch information
brok3turtl3 authored Jun 21, 2024
2 parents 74b4525 + 68437d1 commit 4d49c42
Show file tree
Hide file tree
Showing 16 changed files with 51,849 additions and 14 deletions.
5 changes: 5 additions & 0 deletions client/src/features/userProfile/userProfileSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export const uploadProfilePicture = createAsyncThunk(
'Content-Type': 'multipart/form-data',
},
});
if (process.env.NODE_ENV === 'development') {
console.log('💰 Woah there, that ish costs money 💰');
console.log('❓❓Did Big Sean approve you to tax his AWS account❓❓');
console.log("I didn't think so, get outta here");
}
return response.data;
} catch (error) {
let errorMessage = 'An error occurred during profile picture upload';
Expand Down
38 changes: 33 additions & 5 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,34 @@ services:
container_name: ch-dev
ports:
- '8080:8080'
- '3000:3000'
volumes:
- .:/usr/src/app
- node_modules:/usr/src/app/node_modules
- client_node_modules:/usr/src/app/client/node_modules
command: npm run dev-ts
environment:
- PORT=3000
- NODE_ENV=development
- JWT_SECRET=fakeDevelopmentSecret
- MONGO_URI=mongodb://root:rootPass@ch-mongo-dev:27017/ch-testdb
- DATABASE_URL=postgres://codehammers:ch-dev@postgres:5432/ch-dev-database
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=ch-dev
- POSTGRES_DB=ch-dev-database
- AWS_ACCESS_KEY_ID=placeholder-value
- AWS_SECRET_ACCESS_KEY=placeholder-value
- AWS_REGION=placeholder-value
- BUCKET_NAME=placeholder-value
# AWS credentials and IS_SK environment variables are retrieved from .env file
# Leave AWS credentials undefined unless approved to work on profile picture routes by Big Sean
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- BUCKET_NAME=${BUCKET_NAME}
- IS_SK=${IS_SK}
# suppress aws sdk v2 deprecation warning
- AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1;
depends_on:
- postgres
- ch-mongo-dev
command: npm run dev-ts

postgres:
image: codehammers/postgres-dev:latest
container_name: codehammers-postgres
Expand All @@ -35,7 +44,26 @@ services:
- postgres-data:/var/lib/postgresql/data
ports:
- '5432:5432'

ch-mongo-dev:
image: mongo
container_name: ch-mongo-dev
restart: always
ports:
- 27017:27017
environment:
- MONGO_INITDB_DATABASE=ch-testdb
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=adminpassword
- MONGO_HOST=ch-mongo-dev
- MONGO_USER=root
- MONGO_USER_PWD=rootPass
volumes:
- ./scripts/db/mongo-dev-init/:/docker-entrypoint-initdb.d
- mongo-dev-volume:/data/db
command: mongod --quiet --logpath /dev/null
volumes:
node_modules:
client_node_modules:
postgres-data:
mongo-dev-volume:
4 changes: 0 additions & 4 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_DB=ch-dev-database
- POSTGRES_PASSWORD=ch-dev
- AWS_ACCESS_KEY_ID=placeholder-value
- AWS_SECRET_ACCESS_KEY=placeholder-value
- AWS_REGION=placeholder-value
- BUCKET_NAME=placeholder-value
# suppress aws sdk v2 deprecation warning
- AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1;
command: npm run test:all
Expand Down
8 changes: 7 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ module.exports = [
},
// Files/Directories to be ignored by ESLint
{
ignores: ['**/node_modules/', 'coverage/', '**/build/', '**/dist/'],
ignores: [
'**/node_modules/',
'coverage/',
'**/build/',
'**/dist/',
'**/scripts/db/mongo-dev-init',
],
},
// ESLint Recommended Configuration
{
Expand Down
Loading

0 comments on commit 4d49c42

Please sign in to comment.