Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Generate a project

NeverTwice edited this page Jun 5, 2018 · 8 revisions

In this example let's say we have an application that only needs a database and something to manually run SQL queries

Step 1 : Go to Okty.io

The first obvious step is to go to https://okty.io/ and press "Start Here" !

Okty home page

Step 2 : Select a container

Now, we need something that may manage a database.
Search for your favorite database in the list.
In this example, we'll go on with mysql

Okty search page

Step 3 : Configure MySQL

This is the must important step, you have to tell okty what you really need !
Here is the recommended configuration for this example :

Mysql configuration

Here's some explanation :

General

  • Container ID : This is the container id and should be unique
  • Mysql Port : Port to use on the host computer if you want to connect to the database outside of the application
  • Local path of database folder: Folder where you want to store database files (Allows persistent data storage)

Connection

  • Database name : The name of the database where application data will be stored
  • Mysql user : Username used to access database
  • Mysql password : Password used to access database

Once your configuration is done, save your container by hitting the "submit" button

Step 4 : Is it the end ?

If all we want is a database, we can export our project at this step but we're not really comfortable with mysql command lines and it would be great if we had an UI to manage data

Let's add another container to do this !

Step 5 : Add adminer

We have implemented in okty a light container to manage database through UI.
Adminer is a light container that doesn't require any configuration.

Step 6 : Configure Adminer

Do you remember when I told you that adminer didn't require any configuration ?
That was a lie ... You have to specify host port on which one adminer will be available In our example, default value is fine

Adminer configuration

Step 7 : Export project

Our project is now ready to run ! Just export it and unzip it.
Create an empty folder somewhere on your computer and put the docker-compose file inside it.

Step 8 : Free the power of docker !

Open a terminal and navigate to your folder.
Run : docker-compose up -d

Terminal execution

Step 9 : Is it really working ?

At this point, you have a database running on your computer !
Don't you believe me ? Okay...
Open your favorite internet browser and go to : http://127.0.0.1:8081/

Adminer homepage

In order to connect to your database, you have to specify data from step 3 of this tutorial

WARNING : In this case your have to access database through the container, this means server address isn't 127.0.0.1
If you have to connect to your database from an application inside another container, database ip value is the value specified in "Container ID" of mysql

Step 10 : How shall I shutdown my project ?

If you want to stop your database, all you have to do is run one command
docker-compose stop

And that's all ! Less than 10 steps to run a local database without polluting your computer 😄