-
Notifications
You must be signed in to change notification settings - Fork 7
How to make your project deployment ready
First step is to break your overall project into services that can be run independently. This includes database servers, backend api endpoints, authentication servers etc. Once done, each of these services need to have their own images, for which you will have to use an existing base image from docker hub and write a dockerfile on top of it. Pick a base image that is minimal, in the sense it has all your service dependencies and nothing more. You can refer to dockerfiles of SenData and Citadel for this purpose. You should then write a docker-compose.yml for setting up your multi-container application, for which you will need to expose the appropriate ports of each service. Even if your project consists of only 1 service (like in the case of FreeSpace), a docker-compose is necessary.
Once you are able to clone, build and run your application on your local machine, you need to make a few changes to your docker-compose.yml to make sure it works with deploybot. They are-
- Prefix each image name with
${REGISTRY_NAME}
- For the service you need to expose to the external network, make sure it is connected to the
reverseproxy
network. For this, you can addreverseproxy
to that service’s list of networks, and add the following at the end of the docker-compose -
reverseproxy:
external:
name: "reverseproxy"
- Add
VIRTUAL_HOST
to the environment of the service which you want to be reachable by the subdomain (like the node server in case of SenData). There can be only one such service in your docker-compose.
Helpful links-