- cmd:
docker network create vnet
- cmd:
docker run --name=postgres-1 --network vnet --publish 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=password postgres:13-alpine
- Established connected with postgres using given admin credentials
- sql:
CREATE DATABASE fusionauth ENCODING 'UTF-8' LC_CTYPE 'en_US.UTF-8' LC_COLLATE 'en_US.UTF-8' TEMPLATE template0;
- sql:
CREATE ROLE <ordinary_user> WITH LOGIN PASSWORD '<ordinary_password>';
- sql:
GRANT ALL PRIVILEGES ON DATABASE fusionauth TO <ordinary_user>; ALTER DATABASE fusionauth OWNER TO <ordinary_user>;
- Create schema based on fusionauth version & database type(Mycase postgres). .sql file download link: https://fusionauth.io/direct-download/. filename: fusionauth-database-schema-1.x.x.zip.
- cmd:
docker run --name=fusionauth --network=vnet --publish=9011:9011 -e DATABASE_URL=jdbc:postgresql://postgres-1:5432/fusionauth -e DATABASE_USERNAME=fusionauth_user -e DATABASE_PASSWORD=b19e93a9-dba4-47c6-b32a-c9bba9a2bfdf -e FUSIONAUTH_APP_RUNTIME_MODE=production -e FUSIONAUTH_APP_MEMORY=512M -e SEARCH_TYPE=database -e FUSIONAUTH_APP_URL=http://fusionauth:9011 fusionauth/fusionauth-app:1.28.0