maxpou / docker-symfony

:whale: A docker multicontainer with NGINX, PHP7-FPM, MySQL and ELK (Elasticsearch Logstash and Kibana)
http://www.maxpou.fr/docker-pour-symfony/
MIT License
1.31k stars 474 forks source link

Add Optional Nodejs #25

Open StephenOTT opened 7 years ago

StephenOTT commented 7 years ago

Used more and more in applications for various use cases. Would be great o have optional node similar to optional redis.

marnixbent commented 7 years ago

+1

maxpou commented 7 years ago

Would be great o have optional node similar to optional redis.

As it stand, you can easily add a NodeJS container. After there is too many use case to add it in this stack. Why do you want a NodeJS container in this stack?

tomasyhy commented 7 years ago

I attached NodeJs and NPM by simply editing php7-fpm/Dockerfile I just added two lines:

RUN curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh

and then extend

RUN apt-get update && apt-get install -y \
    openssl \
    git \
    unzip

to

RUN apt-get update && apt-get install -y \
    openssl \
    git \
    unzip \
    nodejs \
    build-essential

If there is a better solution please let me know.

grekpg commented 5 years ago

I get error

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
(23) Failed writing body
Error executing command, exiting
ERROR: Service 'php' failed to build: The command '/bin/sh -c bash nodesource_setup.sh' returned a non-zero code: 1