Answers: <p>I searched for the <strong>healthcheck/postgres:alpine</strong> and I found the following repository with the <strong>Dockerfile</strong>:</p>
  
  <p><a href="https://github.com/docker-library/healthcheck/blob/master/postgres/Dockerfile.alpine" rel="nofollow noreferrer">https://github.com/docker-library/healthcheck/blob/master/postgres/Dockerfile.alpine</a></p>
  
  <p>Assuming this is the correct repo for your docker image, the dockerfile specifies:</p>
  
  <pre><code>FROM postgres
  
  COPY docker-healthcheck /usr/local/bin/
  
  HEALTHCHECK CMD ["docker-healthcheck"]
  </code></pre>
  
  <p>So it extends the postgres docker image which is documented here:</p>
  
  <p><a href="https://hub.docker.com/_/postgres" rel="nofollow noreferrer">https://hub.docker.com/_/postgres</a></p>
  
  <p>Specifically for the password they mention the following:</p>
  
  <blockquote>
    <p>POSTGRES_PASSWORD This environment variable is recommended for you to
    use the PostgreSQL image. This environment variable sets the superuser
    password for PostgreSQL. The default superuser is defined by the
    POSTGRES_USER environment variable.</p>
    
    <p>Note 1: The PostgreSQL image sets up trust authentication locally so
    you may notice a password is not required when connecting from
    localhost (inside the same container). However, a password will be
    required if connecting from a different host/container...</p>
  </blockquote>
  
  <p>Read the whole documentation at the image homepage.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-21T20:40:29.713Z
Answers: 2019-04-21T20:40:29.713Z
Answers: petrchpetr
Body: <p>postgres:</p>
  
  <pre><code>image: healthcheck/postgres:alpine
  environment:
    POSTGRES_USER: postgres
  </code></pre>
  
  <ul>
  <li>What is the default user of postgresql?</li>
  <li>How does hardcoding the postgres user improve security?</li>
  <li>What special rights does the postgres user have?</li>
  <li>What is the upside and downside of using an unprivileged user in this scenario?</li>
  <li>Is it necessary in our scenario to have an unprivileged user?</li>
  </ul>
  
Tags: <docker-compose><postgresql>
Title: i have questions about docker-compose
UserDisplayName: omar amine
ThreadText: # i have questions about docker-compose
  
  (Asked by: username_0 on 2019-04-21)
  
  postgres:
  
  ```
  image: healthcheck/postgres:alpine
  environment:
    POSTGRES_USER: postgres
  
  ```
  
  * What is the default user of postgresql?
  * How does hardcoding the postgres user improve security?
  * What special rights does the postgres user have?
  * What is the upside and downside of using an unprivileged user in this scenario?
  * Is it necessary in our scenario to have an unprivileged user?
  
  **Tags:** docker-compose, postgresql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-21. Score: 1
  
  I searched for the **healthcheck/postgres:alpine** and I found the following repository with the **Dockerfile**:
  
  <https://github.com/docker-library/healthcheck/blob/master/postgres/Dockerfile.alpine>
  
  Assuming this is the correct repo for your docker image, the dockerfile specifies:
  
  ```
  FROM postgres
  
  COPY docker-healthcheck /usr/local/bin/
  
  HEALTHCHECK CMD ["docker-healthcheck"]
  
  ```
  
  So it extends the postgres docker image which is documented here:
  
  <https://hub.docker.com/_/postgres>
  
  Specifically for the password they mention the following:
  
  > POSTGRES\_PASSWORD This environment variable is recommended for you to
  > use the PostgreSQL image. This environment variable sets the superuser
  > password for PostgreSQL. The default superuser is defined by the
  > POSTGRES\_USER environment variable.
  >
  > Note 1: The PostgreSQL image sets up trust authentication locally so
  > you may notice a password is not required when connecting from
  > localhost (inside the same container). However, a password will be
  > required if connecting from a different host/container...
  
  Read the whole documentation at the image homepage.
  
  
  ---
  
  