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

Generate a project

Bassin Laurent edited this page Jun 2, 2018 · 8 revisions

Generate a project

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

Step 1 : Go to Okty.io

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

Okty home page

Step 2 : Select a container

Now, we need something that may manage a database.
Search for you favorite database software 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 to 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 identifiant and should be unique
  • Mysql Port : Port to used 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 "save" button

Step 4 : Is it the end ?

In the case that all we want is a database, we may export our project at this step but we're not really comfortable with mysql command lines and it would be great if we may have 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 just fine

Adminer configuration

Step 7 : Export project

Our project is now ready to be 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 : It is 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 container, this means server isn't 127.0.0.1
If you have to connect to database from an application inside another container, database ip value is the value specified in "Container ID" of mysql

Step 10 : How should I shutdown my project ?

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

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