chendeben 9 лет назад
Родитель
Сommit
a759e1bcce
2 измененных файлов с 3 добавлено и 4 удалено
  1. 2 1
      db/Dockerfile
  2. 1 3
      docker-compose.yml

+ 2 - 1
db/Dockerfile

@@ -2,4 +2,5 @@ FROM postgres
 
 
 MAINTAINER chendeben <chendeben@qq.com>
 MAINTAINER chendeben <chendeben@qq.com>
 
 
-RUN chown -R postgres:postgres /var/lib/postgresql/data
+RUN chown -R postgres:postgres /var/lib/postgresql/data && \
+	chmod -R 700 /var/lib/postgresql/data

+ 1 - 3
docker-compose.yml

@@ -4,12 +4,10 @@ services:
   yidu_postgres:
   yidu_postgres:
     build:
     build:
       context: ./db
       context: ./db
-    environment:
-      - PGDATA=/postgresql/data
     ports:
     ports:
       - "5432:5432"
       - "5432:5432"
     volumes:
     volumes:
-      - ./db/data:/postgresql/data
+      - ./db/data:/var/lib/postgresql/data
   yidu:
   yidu:
     build:
     build:
       context: ./yidu
       context: ./yidu