Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use docker-compose extensively and put nodejs available so all commands works ok #1057

Merged
merged 3 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: "3.2"
services:
php:
app:
restart: unless-stopped
tty: true
build:
context: ./docker/php
context: docker/app
environment:
- DB_DRIVER=mysql
- DB_HOST=ufmysql
Expand All @@ -14,7 +14,7 @@ services:
- DB_PASSWORD=secret
volumes:
- .:/app
- ./docker/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
- ./docker/app/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
networks:
- backend

Expand All @@ -29,7 +29,7 @@ services:
volumes:
- .:/app
depends_on:
- php
- app
- ufmysql
networks:
- frontend
Expand Down
35 changes: 35 additions & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM php:7.2-fpm

RUN apt-get update

RUN apt-get install -y apt-utils

# Add NodeJS LTS Repository
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -

RUN apt-get install -y \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libxslt1-dev \
libxml2-dev \
locales \
zlib1g-dev \
libpng-dev \
libfreetype6-dev \
libjpeg-dev \
zip \
nodejs

# COMPOSER INSTALL
RUN curl -sSfo /tmp/composer.phar https://getcomposer.org/installer
RUN php /tmp/composer.phar --install-dir=/usr/local/bin --filename=composer

# Install and configure PHP extensions
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install -j$(nproc) pdo pdo_mysql \
&& docker-php-ext-install -j$(nproc) zip

WORKDIR /app
File renamed without changes.
2 changes: 1 addition & 1 deletion docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ server {
location = /index.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_keep_conn on;
fastcgi_pass php:9000;
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
Expand Down
17 changes: 0 additions & 17 deletions docker/php/Dockerfile

This file was deleted.