Skip to content

Commit

Permalink
Merge pull request #10 from PHPRio/fix/nodesource
Browse files Browse the repository at this point in the history
Atualiza instalação do Node.js
  • Loading branch information
giovannism20 authored Dec 6, 2023
2 parents 2f6169d + 239920d commit e48392a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
21 changes: 15 additions & 6 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
FROM php:8.2

COPY --from=composer:2.6.5 /usr/bin/composer /usr/bin/composer
ARG NODE_MAJOR=20

RUN apt-get update \
&& apt-get install -y \
git \
# Install node
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install --no-install-recommends -y nodejs \
# Pacotes necessários para instalação do Node.js via NodeSource distributions
ca-certificates \
curl \
gnupg \
# Instala Node.js (veja https://github.com/nodesource/distributions)
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install nodejs -y \
&& node --version \
&& npm --version
&& npm --version \
# Limpa cache de pacotes
&& rm -rf /var/lib/apt/lists/*

# Install PHP extensions
# Install PHP extensions and Composer
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
&& install-php-extensions \
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
services:

backend:
build: .docker
build:
context: .docker
args:
- NODE_MAJOR=${NODE_MAJOR:-20}
ports:
- "127.0.0.1:${HTTP_PORT:-8000}:8000"
volumes:
Expand Down

0 comments on commit e48392a

Please sign in to comment.