1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00
This commit is contained in:
kev 2020-10-22 14:41:34 +08:00
parent 414672f1a6
commit aacfd8a6f6
3 changed files with 11 additions and 9 deletions

@ -10,11 +10,13 @@ postgres:
image: postgres:alpine image: postgres:alpine
ports: ports:
- "5432:5432" - "5432:5432"
volumes:
- ./data:/var/lib/postgresql/data
environment: environment:
- POSTGRES_USER=root - POSTGRES_USER=postgres
- POSTGRES_PASSWORD=root - POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres - POSTGRES_DB=postgres
restart: always restart: unless-stopped
``` ```
## up and running ## up and running
@ -22,7 +24,7 @@ postgres:
```bash ```bash
$ docker-compose up -d $ docker-compose up -d
$ docker-compose exec postgres psql -U root postgres $ docker-compose exec postgres psql -U postgres postgres
>>> SELECT CURRENT_TIMESTAMP; >>> SELECT CURRENT_TIMESTAMP;
now now
------------------------------- -------------------------------

@ -5,7 +5,7 @@ postgres:
volumes: volumes:
- ./data:/var/lib/postgresql/data - ./data:/var/lib/postgresql/data
environment: environment:
- POSTGRES_USER=root - POSTGRES_USER=postgres
- POSTGRES_PASSWORD=root - POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres - POSTGRES_DB=postgres
restart: always restart: unless-stopped

@ -4,5 +4,5 @@ scrapyd:
- "6800:6800" - "6800:6800"
volumes: volumes:
- ./data:/var/lib/scrapyd - ./data:/var/lib/scrapyd
- /usr/local/lib/python2.7/dist-packages - /usr/local/lib/python3.7/dist-packages
restart: always restart: unless-stopped