chrisleekr / yii2-angular-boilerplate

Yii2 REST API + Angular 12 Boilerplate (Frontend/Backend)
https://yam-boilerplate.chrislee.kr/
MIT License
224 stars 101 forks source link

Error When `docker-compose up -d` #70

Open rindibudiaramdhan opened 3 years ago

rindibudiaramdhan commented 3 years ago

I tried this boilerplate for first time for learning how to use yii2. Then I followed How to Start, until I met this error.

image

When I read, it has error at ./api/Dockerfile. Then I change some code to try if that works.

from this,

RUN chmod 700 \
    /usr/local/bin/docker-entrypoint.sh \
    /usr/local/bin/composer

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- \
    # FIXME: Composer 2.0.0 is not compatible with fxp/composer-asset-plugin for now. Set version until it is fixed.
    --version=1.10.16 \
    --filename=composer.phar \
    --install-dir=/usr/local/bin && \
    composer global require --optimize-autoloader \
    "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
    "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
    composer global dumpautoload --optimize && \
    composer clear-cache

to this,

# Install composer from the official image
COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer

RUN chmod +x \
        /usr/local/bin/docker-entrypoint.sh \
        /usr/local/bin/composer && \
    cd ~ && \
    composer global require --optimize-autoloader \
        "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
        "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
    composer global dumpautoload --optimize && \
    composer clear-cache

Then It works.

image

But something happened. In my docker, only mysql, nginx, and memcached are running. image

in api container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

in backend container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

in frontend container it show

standard_init_linux.go:228: exec user process caused: no such file or directory

I dont know what happen. Anybody can explain me why and how to solve it? Thank you so much.

btw, my OS is Windows 10 and I am using Docker Desktop for Windows.

rindibudiaramdhan commented 3 years ago

i solved it because of this. https://futurestud.io/tutorials/how-to-fix-exec-user-process-caused-no-such-file-or-directory-in-docker

maybe @chrisleekr @henryohanga can add this to troubleshoot if OS Windows.

rindibudiaramdhan commented 3 years ago

image

rindibudiaramdhan commented 3 years ago

maybe need change in app/Dockerfile like I note before

chrisleekr commented 3 years ago

@rindibudiaramdhan

I fixed to use composer 2. Please take a look and if it fixed, close the issue.

Thank you.

rindibudiaramdhan commented 2 years ago

Sorry for very very late response. I have this new error

image