Closed nicolas-piquerez closed 7 years ago
Hello, I recently faced the same problem; Here is my Dockerfile.development
FROM webdevops/php-apache-dev:7.1
ENV PROVISION_CONTEXT "development"
COPY etc/ /opt/docker/etc/
RUN chmod 0644 /opt/docker/etc/cron/crontab \ && echo >> /opt/docker/etc/cron/crontab \ && ln -sf /opt/docker/etc/php/development.ini /opt/docker/etc/php/php.ini
RUN apt-get update
RUN apt-get install -y libpq-dev \ && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ && docker-php-ext-install pdo_pgsql pgsql
RUN apt-get install -y zlib1g-dev libicu-dev g++ \ && docker-php-ext-configure intl \ && docker-php-ext-install intl
WORKDIR /app/
Don't run RUN apt-get update
on a single run command, you will create an additional layer which you don't need :)
You can use RUN apt-install libpq-dev ...
on our images, this will handle all stuff automatically :)
We've already discussed adding pgsql on our images and will add this too.
Thank you kyrilg. It works like a charm !!
As mblaschke suggested, i tried without the update, but libpq-dev could not be found. So I kept the update for now :)
Can I ask you how is your docker-compose ? I would like to simplify mine by removing the storage container and the docker volume, I don't need the separate app from storage, or at least I can't see the advantages in my case.
version: '2' services: app: build: context: . dockerfile: Dockerfile links:
cap_add:
POSTFIX_RELAYHOST=[mail]:1025
postgres: build: context: docker/postgres/ dockerfile: Postgres-9.5.Dockerfile ports:
etc/environment.development.yml
storage: build: context: docker/storage/ volumes:
@clenoma just replace apt-get install
by apt-install
and then you can remove apt-get update
:)
@mblaschke would answer better than me but he already told me that the storage was no longer necessary and should be removed
You can go at https://webdevops.io/slack/ to discuss about that
Hello, Have you managed to use postgreSQL ?
I'm trying to replace mysql with postgresql, but I can't get symfony / laravel to connect.
I have the following error when trying to connect to a remote (aws) postgreSQL database : ErrorException in Connection.php line 770: could not find driver
In docker-compose i linked postgre links:
- mail
Removed comments from PostgreSQL config #######################################
PostgreSQL server
####################################### pgsql: build: context: docker/postgres/
dockerfile: Postgres-9.4.Dockerfile
volumes_from:
- storage
It seems the php7 extension for postgreSQL is missing I tried to install it with "RUN /usr/local/bin/apt-install php7.0-pgsql" but can't find any php packages installed :/