6/4/2023 0 Comments Postico into dockerYou could measure the latency of connection and other metrics. This approach is very handy for development purposes but close to production conditions. Now you can start using your remote PostgreSQL and Redis in your project! A GUI tool such as pgAdmin or Postico to interact visually with PostgreSQL. You can use any PostgreSQL client, I am going to show it in Postico.Īfter hitting Connect button, you should see all the tables! Docker Desktop and Docker Compose are required to run Web applications locally. We can see if everything is running alright by establishing a connection to the database. Now if you open db.:6969, you will see Traefik's dashboard: If it doesn't want to resolve the host, then try different WiFi or use mobile data. In order to make it available publicly we have to create DNS A-record pointing to our server's IP, or you can just use your server's IP address.ĭNS records update could take up to 72 hours but usually it happens during 5 minutes. If you'd like to learn more about Traefik, check out the documentation.Īfter that, we can describe PostgreSQL and Redis services. Other configurations look pretty intuitive and simple. We need to describe entry points for PostgreSQL and Redis containers telling Traefik which ports to use for requests redirection. Let's start by creating our first Docker Compose service - Traefik. Starting from the second version, they have made it possible to configure TCP ports that gives us ability to expose PostreSQL and Redis containers to public. If you are not familiar with Traefik, it's a great proxy server that I use already 3 years for all the projects. After pressing it, Terminal window connected to the droplet will pop up.Īfter we have set up the server, we can create a docker-compose.yml file with Traefik, PostgreSQL and Redis services. Press on the droplet to open its configuration, and in the right top corner, you will see Console button. DigitalOcean provides a built-in console, so we can just open it from the browser. Then, click create and wait till the process is done.īefore proceeding to the next step, let's check if we can connect to our droplet through the console. You will also need to specify a name, region and some other configurations for the server. I, personally, use a preconfigured droplet with Docker from DO's marketplace. Navigate to a dashboard where you create new droplet and fill in the configurations you prefer. We are going to use DigitalOcean to set up a droplet for $5, however, feel free to use any cloud service you like. If you'd like to make PostgreSQL and Redis available from your domain, rather than direct server's IP address, you should have a registered domain and access to a dashboard where you can change DNS records. In order to fully complete the guide, you will need to have some familiarity with Terminal and Docker. So you can have a shared database among the team mates without messing local setups. Enter fullscreen mode Exit fullscreen mode
0 Comments
Leave a Reply. |