Poco Hello World
In this tutorial we will create Poco Project, add it to our Poco Repo,
for this we will use simple nginx to serve our source html.
Step 1: Init Git Repository
Before we start lets init git repository:
$:~ mkdir poco-hello-world |
Step 2: Add source files
When git repository is ready lets add some source files to our project first,
so we will be able to see that our ngnix server is workink correctly.
Create index.html
file inside /source/www
folder:
<!doctype html> |
Step 3: Configure Docker Compose
We recommend to split docker-compose files by services (one file - one service),
this will help to make project more flexible.
Create dc-nginx.yaml
file inside /docker
folder and map our source folder:
version: '3' |
Step 4: Configure Nginx server
Let’s adjust a little bit our nginx server so it better suit to our needs.
Create nginx.conf
file in /docker/config
:
events { |
To tell our nginx server to use our config file we need to map it in our /dockder/dc-nginx.yaml
file:
version: '3' |
Step 5: Configure Poco Project
When docker compose is ready we can add it to our poco.yaml
:
version: '1.0' |
Step 6: Check your project
Finally we can check our project:
$:~ poco up |
Open “http://localhost" in your browser, if everything is ok you should see “Hello World!”.
Step 7: Create Poco Repo
Create remote git repository on Github, Gitlab or Bitbucket, add it to your local Poco config:
$:~ poco repo add default https://git-repository-url |
If everything is ok you should see something like this:
Actual config |
Step 8: Add your project to your Poco Repo
Now we can add our project to Poco Repo, run this command in root folder of the project:
$:~ poco project add . default |
When your project is added you can publish your Poco Repo:
$:~ poco repo push |
Poco Hello World Example Project
You can try Poco Hello World Example project. Just add Poco Repo:
$:~ poco repo add poco-examples git@github.com:shiwaforce/poco-examples.git |
List out all available projects:
$:~ poco project ls |
Run Poco Hello World Project:
$:~ poco up poco-example-hello-world |