Added node docker service

This commit is contained in:
2023-12-04 10:20:47 +03:00
parent d3ef5f97cb
commit 341de2dff6
4 changed files with 57 additions and 5 deletions

View File

@@ -32,11 +32,17 @@ lint-code-style:
artisan:
docker-compose exec php-fpm ./artisan $(ARGS)
mysql-console:
docker-compose exec mysql mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}
init: clone copy-infra-env compose-down compose-up setup-laravel-packages copy-laravel-env setup-laravel-key run-migrations fix-permissions
start-frontend:
docker-compose exec php-fpm npm run watch
start-frontend-prod:
docker-compose exec php-fpm npm run production
node-frontend-deps:
docker-compose exec php-fpm npm i --legacy-peer-deps
init: clone copy-infra-env compose-down compose-up setup-laravel-packages copy-laravel-env setup-laravel-key run-migrations node-frontend-deps start-frontend-prod fix-permissions

View File

@@ -80,6 +80,22 @@ services:
ns-eatvio:
ipv4_address: 172.118.0.4
frontend:
build:
context: ./phpdocker/node
dockerfile: Dockerfile.dev
networks:
ns-eatvio:
ipv4_address: 172.118.0.6
volumes:
- ./app:/application
command: ["npm", "run", "watch"]
working_dir: /application
# labels:
# - "traefik.enable=false"
restart: always
networks:
web:
external: true

25
phpdocker/node/Dockerfile.dev Executable file
View File

@@ -0,0 +1,25 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Moscow
ENV PATH=node_modules/.bin:$PATH
WORKDIR /application
RUN apt-get update && apt-get install -y \
# make \
curl \
libpq-dev \
libzip-dev \
unzip \
zip
RUN apt-get update && apt-get install -y \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update && apt-get install -y nodejs && npm install -g npm@10.1.0
ENV PATH=node_modules/.bin:$PATH

View File

@@ -9,3 +9,8 @@ RUN apt-get update; \
php8.2-pgsql; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update && apt-get install -y nodejs && npm install -g npm@10.1.0
ENV PATH=node_modules/.bin:$PATH