Browse Source

+ possible change node version with build finish image of workspace

master
parent
commit
73e2eb7853
  1. 1
      .env.example
  2. 3
      docker-compose.base.yml
  3. 17
      dockerfiles/php-fpm/php73.Dockerfile
  4. 17
      dockerfiles/workspace/workspace74.Dockerfile

1
.env.example

@ -6,6 +6,7 @@ PROJECTS_DIR=/home/youruser/PhpstormProjects
WORKSPACE_PUID=1000 WORKSPACE_PUID=1000
WORKSPACE_PGID=1000 WORKSPACE_PGID=1000
WORKSPACE_TIMEZONE=Europe/Moscow WORKSPACE_TIMEZONE=Europe/Moscow
WORKSPACE_CUSTOM_NODE_VERSION=lts/erbium
### PHP-FPM ############################################# ### PHP-FPM #############################################
INSTALL_REDIS=true INSTALL_REDIS=true

3
docker-compose.base.yml

@ -37,9 +37,10 @@ services:
build: build:
context: ./dockerfiles/workspace context: ./dockerfiles/workspace
args: args:
- CUSTOM_PUID=1001
- CUSTOM_PUID=${WORKSPACE_PUID}
- CUSTOM_PGID=${WORKSPACE_PGID} - CUSTOM_PGID=${WORKSPACE_PGID}
- CUSTOM_TZ=${WORKSPACE_TIMEZONE} - CUSTOM_TZ=${WORKSPACE_TIMEZONE}
- CUSTOM_NODE_VERSION=${WORKSPACE_CUSTOM_NODE_VERSION}
restart: always restart: always
volumes: volumes:
- ${PROJECTS_DIR}:/var/www - ${PROJECTS_DIR}:/var/www

17
dockerfiles/php-fpm/php73.Dockerfile

@ -50,3 +50,20 @@ RUN apt update && \
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \ sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen locale-gen
###########################################################################
# Install custom node version
###########################################################################
USER root
ARG CUSTOM_NODE_VERSION
ENV CUSTOM_NODE_VERSION ${CUSTOM_NODE_VERSION}
RUN if [ ${CUSTOM_NODE_VERSION} = true ]; then \
. ~/.bashrc && nvm install lts/erbium \
&& . ~/.bashrc && nvm alias default lts/erbium \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi

17
dockerfiles/workspace/workspace74.Dockerfile

@ -48,3 +48,20 @@ USER root
COPY ./crontab74 /etc/cron.d COPY ./crontab74 /etc/cron.d
RUN chmod -R 644 /etc/cron.d RUN chmod -R 644 /etc/cron.d
###########################################################################
# Install custom node version
###########################################################################
USER root
ARG CUSTOM_NODE_VERSION
ENV CUSTOM_NODE_VERSION ${CUSTOM_NODE_VERSION}
RUN if [ ${CUSTOM_NODE_VERSION} = true ]; then \
. ~/.bashrc && nvm install lts/erbium \
&& . ~/.bashrc && nvm alias default lts/erbium \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi
Loading…
Cancel
Save