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

From wikieduonline
Jump to navigation Jump to search
Line 3: Line 3:
  
 
== Basic example ==
 
== Basic example ==
<pre>
+
# Use postgres/example user/password credentials
+
# Use postgres/example user/password credentials
version: '3.1'
+
version: '3.1'
 
+
services:
+
services:
 
+
 
   db:
 
   db:
 
     image: postgres
 
     image: postgres
Line 14: Line 14:
 
     environment:
 
     environment:
 
       POSTGRES_PASSWORD: example
 
       POSTGRES_PASSWORD: example
 
+
   adminer:
+
   [[adminer]]:
 
     image: adminer
 
     image: adminer
 
     restart: always
 
     restart: always
 
     ports:
 
     ports:
 
       - 8080:8080
 
       - 8080:8080
</pre>
 
  
 
== Advanced example ==
 
== Advanced example ==

Revision as of 10:17, 27 June 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_USER: postgres
      POSTGRES_PASSWORD: example

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

See also

Advertising: