I
I
Igor2019-09-05 14:17:00
PHP
Igor, 2019-09-05 14:17:00

Docker compose nuxt + php + mysql + nging?

Colleagues, good afternoon!
Problem: The
project is written under
>= php7.2
>= mysql 8
As it turned out, the vps where the project is planned to be deployed has php 7.0 installed and I'm sure mysql < 8
There are 200 sites on this vps.
In short, I do not want to break!
It was decided to use docker
. Began to collect information, test.
It seems like everything is installed, but here

...
Step 12/12 : CMD php-fpm -F
 ---> Using cache
 ---> bd3782b69a79
Successfully built bd3782b69a79
Successfully tagged catalog_app:latest
Building nuxt-admin
ERROR: Cannot locate specified Dockerfile: Dockerfile
[email protected]:/mnt/ssd/web/gorodbrand.ru/catalog$ docker-compose build

Dockerfile
#https://jonathanmh.com/deploying-a-nuxt-js-app-with-docker/

FROM node:10-alpine


ENV APP_ROOT /nuxt-app
ENV APP_FROM ./../../nuxt_admin

# создать каталог назначения
RUN mkdir -p ${APP_ROOT}
WORKDIR ${APP_ROOT}

COPY ${APP_FROM}/package*.json ./
COPY ${APP_FROM} ${APP_ROOT}

RUN npm install
RUN npm run build


EXPOSE 5100

# установить приложение, обслуживающее разрешающее / назначенное
ENV NUXT_HOST=0.0.0.0
# установить порт приложения
ENV NUXT_PORT=3000


# запустить приложение
CMD [ "npm", "start" ]

docker-compose.yml
version: "3"

services:
  app:
    container_name: gorodbrand.app
    build: ./docker/php
    links:
      - mysql
    volumes:
      - .:/var/www


  nginx-admin:
    container_name: gorodbrand.nginx-admin
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./hosts:/etc/nginx/conf.d
      - ./web/admin:/var/www
      - ./logs:/var/log/nginx
    links:
      - app


  nginx-api:
    container_name: gorodbrand.nginx-api
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./hosts:/etc/nginx/conf.d
      - ./web/api:/var/www
      - ./logs:/var/log/nginx
    links:
      - app


  mysql:
    container_name: gorodbrand.mysql
    image: mysql:8
    ports:
      - "3306:3306"
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: secret


  nuxt-admin:
    container_name: gorodbrand.nuxt_admin
    build: ./nuxt_admin
    ports:
      - "3101:3000"
    volumes:
      - ./nuxt_admin:/usr/nuxt-app


  nuxt-public:
    container_name: gorodbrand.nuxt_public
    build: ./nuxt_public
    ports:
      - "3102:3000"
    volumes:
      - ./nuxt_admin:/usr/nuxt-app

File scheme
5d70ef2110791758908724.png
Maybe the trouble with nuxt in docker is superfluous?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question