You've already forked dockerfiles
mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-06-14 23:55:02 +02:00
add postgres
This commit is contained in:
33
postgres/README.md
Normal file
33
postgres/README.md
Normal file
@ -0,0 +1,33 @@
|
||||
postgres
|
||||
========
|
||||
|
||||

|
||||
|
||||
## docker-compose.yml
|
||||
|
||||
```yaml
|
||||
postgres:
|
||||
image: postgres:alpine
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_USER=root
|
||||
- POSTGRES_PASSWORD=root
|
||||
- POSTGRES_DB=postgres
|
||||
restart: always
|
||||
```
|
||||
|
||||
## up and running
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d
|
||||
|
||||
$ docker-compose exec postgres psql postgres
|
||||
>>> SELECT CURRENT_TIMESTAMP;
|
||||
now
|
||||
-------------------------------
|
||||
2016-12-07 01:44:29.872928+00
|
||||
(1 row)
|
||||
|
||||
>>> \q
|
||||
```
|
11
postgres/docker-compose.yml
Normal file
11
postgres/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
postgres:
|
||||
image: postgres:alpine
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=root
|
||||
- POSTGRES_PASSWORD=root
|
||||
- POSTGRES_DB=postgres
|
||||
restart: always
|
Reference in New Issue
Block a user