Merge pull request #1624 from omnivore-app/add-demo-user
Add demo user in docker-compose migrate service
This commit is contained in:
@ -21,7 +21,7 @@ services:
|
||||
context: .
|
||||
dockerfile: ./packages/db/Dockerfile
|
||||
container_name: "omnivore-migrate"
|
||||
command: '/bin/sh ./packages/db/setup.sh'
|
||||
command: '/bin/sh ./packages/db/setup.sh' # Also create a demo user with email: demo@omnivore.app, password: demo
|
||||
environment:
|
||||
- PGPASSWORD=postgres
|
||||
- PG_HOST=postgres
|
||||
|
||||
@ -8,7 +8,7 @@ COPY tsconfig.json .
|
||||
|
||||
COPY /packages/db/package.json ./packages/db/package.json
|
||||
|
||||
RUN apk --no-cache --virtual build-dependencies add postgresql
|
||||
RUN apk --no-cache --virtual build-dependencies add postgresql uuidgen
|
||||
|
||||
RUN yarn install
|
||||
|
||||
|
||||
@ -5,3 +5,9 @@ echo "created app_user"
|
||||
yarn workspace @omnivore/db migrate
|
||||
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "GRANT omnivore_user TO app_user;"
|
||||
echo "granted omnivore_user to app_user"
|
||||
|
||||
# create demo user with email: demo@omnivore.app, password: demo
|
||||
USER_ID=$(uuidgen)
|
||||
PASSWORD='$2a$10$nxdWohvkWWpmQ28aTq0BK./pRgt6/WDrWyArvod8uWqxpFu/cfVoy'
|
||||
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "INSERT INTO omnivore.user (id, source, email, source_user_id, name, password) VALUES ('$USER_ID', 'EMAIL', 'demo@omnivore.app', 'demo@omnivore.app', 'Demo User', '$PASSWORD'); INSERT INTO omnivore.user_profile (user_id, username) VALUES ('$USER_ID', 'demo');"
|
||||
echo "created demo user with email: demo@omnivore.app, password: demo"
|
||||
|
||||
Reference in New Issue
Block a user