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

From wikieduonline
Jump to navigation Jump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{lc}}
  
 
https://hub.docker.com/_/postgres?tab=description
 
https://hub.docker.com/_/postgres?tab=description
  
== Basic example ==
+
== Example ==
<pre>
 
# Use postgres/example user/password credentials
 
version: '3.1'
 
 
 
services:
 
  
 +
 +
# Use postgres/example user/password credentials
 +
version: '3.1'
 +
 +
services:
 +
 
   db:
 
   db:
     image: postgres
+
     [[image]]: postgres
 
     restart: always
 
     restart: always
 
     environment:
 
     environment:
 +
      POSTGRES_USER: postgres
 
       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 ==
 
 
<pre>
 
# Use postgres/example user/password credentials
 
version: '3.1'
 
 
services:
 
  
  db:
+
== Activities ==
    image: postgres
+
* Add a docker-compose for PostgreSQL with a [[volume]] or [[Bind mounts (Docker)|bind mounts]]
    restart: always
 
    environment:
 
      POSTGRES_USER: postgres
 
      POSTGRES_PASSWORD: example
 
  
  adminer:
+
== Related ==
    image: adminer
+
* <code>[[docker compose up]]</code>
    restart: always
 
    ports:
 
      - 8080:8080
 
</pre>
 
  
 
== See also ==
 
== See also ==
 
* {{docker-compose}}
 
* {{docker-compose}}
 
* {{PostgreSQL}}
 
* {{PostgreSQL}}
 +
 +
[[Category:Docker]]

Latest revision as of 17:26, 15 July 2024

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

Example[edit]

# 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

Activities[edit]

Related[edit]

See also[edit]

Advertising: