Postgres Docker Installation Guide
Codacy requires a working installation of Postgres to work. Depending on the number of projects you are running you might need different requirements.
4 cores CPU
8 GB RAM
Minimum 100 GB+ Hard Drive - this will depend on the number of projects you have. For a custom recommendation, please contact us at firstname.lastname@example.org.
If you already have a Postgres installation, jump directly to step 1.3.
Codacy officially supports Postgres versions 9.3 and 9.4. Codacy requires 'UTF-8' encoding. Make sure that your database character set is correctly configured. For more information see https://www.postgresql.org/docs/9.4/static/multibyte.html
1 - Postgres
Although the Postgres installation is outside the scope of this document, here are some quick steps to have a running Postgres installation using Docker.
1.1 - Retrieve Postgres 9.4 image
1.2 - Run postgres
This will run Postgres in a new docker, naming the container 'application_db'. Also, the user 'postgres' will have its password changed to 'mysecretpassword'. Feel free to change this to whatever you want.
To test the new DB, you can try to
*psql* to it:
To check for local IP and port, just run:
This will be important to properly configure Codacy to access your local Postgres docker.
1.3 - Creating user
It is advised that you create a particular user that will only be able to access Codacy specific databases. To do so, using the
psql shell, create a user:
You can change the username/password to suit your security needs.
Make sure that you can connect to the Postgres database using the newly created user. For additional settings, follow the steps in the Postgres documentation.