提交postgresql的docker容器

This commit is contained in:
KennyLee 2017-11-15 18:04:55 +08:00
parent 17710e8392
commit 4bf40b6e95
2 changed files with 34 additions and 0 deletions

15
postgresql/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM postgres:10.1-alpine
MAINTAINER kennylee26 <kennylee26@gmail.com>
# 使用阿里云镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# Install base packages
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add curl bash tzdata tar unzip && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
echo -ne "Alpine Linux 3.6 image. (`uname -rsv`)\n" >> /root/.built && \
rm -fr /tmp/* /var/cache/apk/*

19
postgresql/README.md Normal file
View File

@ -0,0 +1,19 @@
# PostgreSQL
使用方法参考:
```
postgresql:
restart: always
image: postgres:9.6.2-alpine
environment:
- POSTGRES_USER=gitlab
- POSTGRES_PASSWORD=gitlab
- POSTGRES_DB=gitlabhq_production
# the following are hints on what volumes to mount if you want to persist data
# volumes:
# - data/postgresql:/var/lib/postgresql:rw
```
官方 https://hub.docker.com/_/postgres/