diff --git a/Dockerfile b/Dockerfile index f129e84..cd93ce1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,24 +8,20 @@ ENV SYLIUS_VERSION 1.1.1 ENV BASE_DIR /var/www ENV SYLIUS_DIR ${BASE_DIR}/sylius +RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - + +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ + nodejs + +# Install NodeJs dependencies +RUN npm install -g yarn gulp + #Modify UID of www-data into UID of local user RUN usermod -u ${AS_UID} www-data # Operate as www-data in SYLIUS_DIR per default WORKDIR ${BASE_DIR} -# Create Sylius project -USER www-data -RUN composer create-project \ - sylius/sylius-standard \ - ${SYLIUS_DIR} \ - ${SYLIUS_VERSION} \ - && chmod +x sylius/bin/console \ - # Patch Sylius Standard from master (required for version < 1.1) \ - && cd sylius \ - && rm -f app/config/parameters.yml \ - && curl -o app/config/parameters.yml.dist https://raw.githubusercontent.com/Sylius/Sylius-Standard/master/app/config/parameters.yml.dist \ - && composer run-script post-install-cmd USER root # entrypoint.d scripts diff --git a/Makefile b/Makefile index c6ee400..32c8515 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,14 @@ shell:: ##@Development Bring up a shell ${NAME}-app \ bash +.PHONY: create-project +create-project:: + docker exec \ + -it \ + -u www-data \ + ${NAME}-app \ + composer create-project sylius/sylius-standard sylius 1.1.1 && chmod +x sylius/bin/console + .PHONY: console console:: ##@Development Call Symfony "console" with "console []" docker exec \ diff --git a/README.md b/README.md index 889d1ca..e6620f0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ Because ``docker-compose.yml`` uses Compose file format 2.1 at least **Docker ve git clone https://github.com/sylius/docker sylius-docker make help make up +make create-project +make shell + - cd sylius + - yarn install + - yarn run gulp + - gulp make console CMD=sylius:install ``` diff --git a/docker-compose.yml b/docker-compose.yml index 57f90ea..6459e0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: context: . args: - AS_UID=${AS_UID:-33} + volumes: + - ./sylius:/var/www/sylius environment: - SYLIUS_DATABASE_HOST=mysql - SYLIUS_DATABASE_USER=sylius @@ -32,3 +34,11 @@ services: image: mailhog/mailhog:latest ports: - 8025:8025 + node: + container_name: ${NAME}-node + build: + context: docker/node + user: node + volumes: + - ./sylius:/srv/sylius + working_dir: /srv/sylius diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile new file mode 100644 index 0000000..ad4afcd --- /dev/null +++ b/docker/node/Dockerfile @@ -0,0 +1,3 @@ +FROM node:7.10.1 + +RUN npm install -g yarn gulp diff --git a/sylius/.gitignore b/sylius/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/sylius/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore