mirror of
https://github.com/antonkomarev/github-profile-views-counter.git
synced 2026-03-31 06:24:11 -04:00
Add postgres database container to test PDO driver
This commit is contained in:
@@ -3,16 +3,23 @@
|
||||
# ----------------------
|
||||
FROM php:7.4-fpm-alpine AS dev
|
||||
|
||||
RUN apk add \
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
$PHPIZE_DEPS \
|
||||
freetype-dev \
|
||||
libpng-dev
|
||||
libpng-dev \
|
||||
postgresql-dev
|
||||
|
||||
# Cleanup apk cache and temp files
|
||||
RUN rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
# Configure php extensions
|
||||
RUN docker-php-ext-configure gd --with-freetype
|
||||
|
||||
# Install php extensions
|
||||
RUN docker-php-ext-install \
|
||||
gd
|
||||
gd \
|
||||
pdo \
|
||||
pdo_pgsql
|
||||
|
||||
# Cleanup apk cache and temp files
|
||||
RUN rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/.docker-volume-postgres/
|
||||
/.idea/
|
||||
/vendor/
|
||||
.env
|
||||
.idea/
|
||||
|
||||
@@ -7,6 +7,8 @@ services:
|
||||
context: ./
|
||||
dockerfile: ./.docker/php/Dockerfile
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./:/app
|
||||
@@ -30,6 +32,25 @@ services:
|
||||
networks:
|
||||
- ghpvc
|
||||
|
||||
postgres:
|
||||
container_name: ${PROJECT_NAME}-postgres
|
||||
image: postgres:13.4-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${DB_PORT:-5432}:${DB_PORT:-5432}"
|
||||
environment:
|
||||
- POSTGRES_USER=${DB_USER}
|
||||
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
||||
- POSTGRES_DB=${DB_NAME}
|
||||
volumes:
|
||||
- ./.docker-volume-postgres:/var/lib/postgresql/data
|
||||
networks:
|
||||
- ghpvc
|
||||
|
||||
volumes:
|
||||
.docker-volume-postgres:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
ghpvc:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user