Jump to content
Sign in to follow this  
tgbs

App for docker

Recommended Posts

I read from web that Linux service are created via Fork() . But this cannot be used in linux containers. Because engine look for master pid and finish execution if it stopped.

Is there any skeleton of such a program. I will use the application in a docker, which will be accessed through Nginx.

Share this post


Link to post

Using fork() is the Linux way, but you don't have to worry about that in a docker environment. In Docker, you can simply rely on creating a simple console app. You then just rely on Docker Swarm or Kubernetes to be running on the host machine running the container as required.

 

You simply need to provide a CMD or ENTRYPOINT in the Dockerfile referencing your command line application.

 

I forgot you mentioned NGINX... So it depends how 'pure' you want to be... the 'pure' way is you have 2 containers: 1) nginx and 2) your app....

 

However, there is nothing stopping you from creating one container with NGINX and your application in it, but it is a container anti-pattern.   

Edited by darnocian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×