fbpx
vshosting~

Most manuals for application dockerization that you’ll find online are written for a specific language and environment. We will, however, look into general guidelines meant for virtually any type of application and show you, how to ensure their operation in Docker containers.

Base Image Selection

For issue-free operation and further simple edits and upgrades, choosing the most ideal (and author-supported) base image is critical. Considering that absolutely anyone can upload an image to the Docker Hub, it is advisable to take a close look at your selected image and make sure that it contains no malicious software or e.g. outdated library versions with security issues. 

Images labeled as “Docker certified” are a good choice for the start as that status is a certain guarantee that the image is legitimate and regularly updated. Good examples of such images are PHP or Node.js.

Furthermore, we can recommend the Bitnami company collection that contains a number of ready-made image applications and development environments. 

Additional Software Installation

Depending on the image you have chosen for your project, you can install extra software so that all prerequisites necessary for smooth application operation are fulfilled.  

The best solution is the use of a package distribution system, on which the image is based (usually Ubuntu/Debian, Alpine Linux, or CentOS). It is also very important to maintain the narrowest possible list of installed software, e.g. not install text editors, compilators, and other development tools into the containers.

Own Files in the Docker Image

You’ll also want to add your own files into the final image – be it configuration, source codes, or binary files from the app. In Dockerfile, the commands ADD or COPY are used, COPY being more transparent but not allowing for some more advanced functions such as archive unpacking into the image.

Authorisation Definition

Despite it being the easiest way, avoid running the app in a container as the root user. This poses many security risks and increases the chance of container leak if the application becomes compromised or if a security error in third-party software you’re using is exploited.

Service Port Definition

If your application doesn’t use the root user or has no enhanced capabilities (CAP_NET_ADMIN), it is not possible to utilise the so-called privileged ports. (1-1024). However, that is not necessary for Docker. Use any higher port (e.g. 8080 and 8443 in place of 80/443 with a web server) and conduct port mapping via the  Docker parameters.

Running the Application in the Container

However easy it is to directly run the binary file of your application(or web server, Node.js, etc.), the much more sophisticated way is to create your own so-called entrypoint – that is a script, which will conduct the initial application configuration, can react to a variable environment etc. We can find a good example of this solution in the official PostgreSQL image.

Configuration Methods

Most applications require correct configuration to run properly. It is certainly possible to directly use a configuration file (e.g. in a mounted directory on the outside of the container) but in most cases, it is better to use a prepared entry point script, which will prepare proper configuration for running the application using a template and the variable environment of the container.

Application Data

Avoid saving data to the container filesystem – in the standard configuration, all the data will be deleted after the container is restarted. Use bind mounts (addressbook outside the container directory on the outside of the container) or mounted volume.

In addition, it is necessary to figure out how to save/send logs. The best option is certainly using centralised logging for all of your applications (ELK stack), however, even a basic  remote syslog does a good enough job.

What next?

There is always room for improvement. Beyond the scope of this article is considering different configuration management options, ELK stack for logging, application and system metrics collection via Prometheus, and the option of reaching load balancing and high-availability for your application using Kubernetes – which at vshosting~, we will gladly build for you and tailor it to your application’s needs 🙂


Damir Špoljarič

The hosting market is continuously developing and vshosting~ is not lagging behind. Which is why this year, we are adding more managed services and private cloud services to our portfolio. On top of that, we will be growing internationally and increasing the complexity of our services. In order to make this evolution crystal clear to the outside, we are also changing our logo and overall identity.

New Services, More Complexity, and a Second Data Centre

The hosting service market has been changing rapidly in the past several years: the main trends being the shift towards managed and cloud solutions, support of new technologies such as Kubernetes, as well as the ever-growing need for top of the line security. At vshosting~, we are on top of things and significantly widening our portfolio with further managed services and private cloud. We have launched our Platform for Kubernetes service already last year and our high-level security has been keeping up with cutting edge standards for years. In addition, we are developing a brand new product: the automated infrastructure for developers, Zerops.

Aside from introducing new services, we are increasing the complexity of the current ones in order to be able to provide our clients with even more customised solutions. In our expanded service portfolio, you will find two Managed Server options, Private Cloud, Managed Database and Managed Platform for Kubernetes. As always, we are using open-source technologies.

Such degree of innovation is enabled by the fact that since our founding, we have been investing all of vshosting~ profits back into the company. We specifically focus on improving and extending the technological infrastructure, optimisation of internal processes, and expanding our team. We built our own data centre in Prague and are also building our own global CDN network (just this week, we expanded it to Seville and Bucharest).

Because the capacity of our data centre will soon stop being able to keep up with the demand for our services, we are building a second data centre, which will be unique in many ways. It will be the first central European, direct current powered data centre with three types of freecooling and it will utilise our own server hardware we are currently developing, following in the footsteps of Google or Facebook.

Upcoming European Expansion

We provide managed hosting for almost half of Czech and Slovak e-shops and hundreds of large internet projects, for whom we operate a complex infrastructure. In less than 13 years, we have made a name for ourselves on the hosting market and become the largest provider of premium and managed services in the Czech Republic and Slovakia.

Now, however, the time has come to grow to other European countries. That is why we are preparing to enter the Polish market this year. With our new service Zerops currently in development, we aim to grow to Germany.  

vshosting~ with a New Look

So that our development is apparent from the outside as well, we updated our logo and overall identity. Aleš Rechtorík and Miloslav Nosovský are the men behind our fresh, new look.

“The main element of the logo is the “wave”, so-called “tilda”, which is used (among other things) in operating systems of the Unix type as an indicator of current user’s home directory. It’s a shortcut. Between us, the client, and technologies,” the logo’s co-creator, Aleš Rechtorík, explains its main element.

The colors of the new identity, dominated by the unusual combination of blue, yellow and green, come from the colors of the cables used in the ServerPark data center. The very same cables also inspired another graphical element of the new identity, the so-called “cableporn”.


We have successfully assisted with migrations for hundreds of clients over the course of 17 years. Join them.

  1. Schedule a consultation

    Simply leave your details. We’ll get back to you as soon as possible.

  2. Free solution proposal

    A no commitment discussion about how we can help. We’ll propose a tailored solution.

  3. Professional implementation

    We’ll create the environment for a seamless migration according to the agreed proposal.

Leave us your email or telephone number




    Or contact us directly

    +44 3301 900 777 Available 24/7
    consultation@vshosting.co.uk
    Copy
    We'll get back to you right away.