Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ services:
- db
- localstack
working_dir: /app/api
command: ["/bin/sh", "-c", "sleep 5 && npx ts-node script/storage/seedData.ts && npm run build && pm2-runtime start /app/pm2/pm2-dev.json"]

command: >
/bin/sh -c "
sleep 5 &&
npx ts-node script/storage/seedData.ts &&
npm run build &&
if [ \"$NODE_ENV\" = \"production\" ]; then
pm2-runtime start /app/pm2/pm2-prod.json --watch;
else
pm2-runtime start /app/pm2/pm2-dev.json --watch;
fi
"
volumes:
db_data:
7 changes: 5 additions & 2 deletions api/script/storage/seedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,8 @@ async function seed() {
}
}

// Run the seed function
seed();
if (process.env.NODE_ENV !== "production") {
seed();
} else {
// Do nothing
}