Difference between revisions of "Docker-compose.xml PostgreSQL"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
  
 
https://hub.docker.com/_/postgres?tab=description
 
https://hub.docker.com/_/postgres?tab=description
 +
 +
== Basic example ==
 
<pre>
 
<pre>
 
# Use postgres/example user/password credentials
 
# Use postgres/example user/password credentials
Line 20: Line 22:
 
</pre>
 
</pre>
  
 +
== Advanced example ==
 +
 +
<pre>
 +
# Use postgres/example user/password credentials
 +
version: '3.1'
 +
 +
services:
 +
 +
  db:
 +
    image: postgres
 +
    restart: always
 +
    environment:
 +
      POSTGRES_PASSWORD: example
 +
 +
  adminer:
 +
    image: adminer
 +
    restart: always
 +
    ports:
 +
      - 8080:8080
 +
</pre>
  
 
== See also ==
 
== See also ==
 
* {{docker-compose}}
 
* {{docker-compose}}
 
* {{PostgreSQL}}
 
* {{PostgreSQL}}

Revision as of 12:25, 2 February 2020

https://hub.docker.com/_/postgres?tab=description

Basic example

# Use postgres/example user/password credentials
version: '3.1'

services:

  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: example

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

Advanced example

# Use postgres/example user/password credentials
version: '3.1'

services:

  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: example

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

See also

Advertising: