Skip to content

Instantly share code, notes, and snippets.

@ramkumarrammohan
Last active June 23, 2021 07:26
Show Gist options
  • Save ramkumarrammohan/4f5d96f3b55ec521d8e32f3734d42907 to your computer and use it in GitHub Desktop.
Save ramkumarrammohan/4f5d96f3b55ec521d8e32f3734d42907 to your computer and use it in GitHub Desktop.
Fusionauth local setup with docker container

Steps to follow complete fusionauth inside docker container

Create netowrk

  1. cmd: docker network create vnet

Database setup - postgres container instance

  1. cmd: docker run --name=postgres-1 --network vnet --publish 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=password postgres:13-alpine
  2. Established connected with postgres using given admin credentials
  3. sql: CREATE DATABASE fusionauth ENCODING 'UTF-8' LC_CTYPE 'en_US.UTF-8' LC_COLLATE 'en_US.UTF-8' TEMPLATE template0;
  4. sql: CREATE ROLE <ordinary_user> WITH LOGIN PASSWORD '<ordinary_password>';
  5. sql: GRANT ALL PRIVILEGES ON DATABASE fusionauth TO <ordinary_user>; ALTER DATABASE fusionauth OWNER TO <ordinary_user>;
  6. 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.

Fusionauth setup - fusionauth container instance

  1. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment