Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add node.js #1821

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion docker-compose.yml
Expand Up @@ -230,7 +230,29 @@ services:
- "dockerhost:${DOCKER_HOST_IP}"
networks:
- backend
### Laravel Horizon ############################################


### NODEJS ##############################################
nodejs:
build:
context: ./nodejs
args:
- LARADOCK_NODE_VERSION=${NODE_VERSION}
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
expose:
zuohuadong marked this conversation as resolved.
Show resolved Hide resolved
- "3000-3010"
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
environment:
- TZ=${NODE_TZ}
depends_on:
- workspace
networks:
- frontend
- backend


laravel-horizon:
build:
context: ./laravel-horizon
Expand Down
10 changes: 10 additions & 0 deletions env-example
Expand Up @@ -60,6 +60,10 @@ DOCKER_HOST_IP=10.0.75.1
# Choose a Remote Interpreter entry matching name. Default is `laradock`
PHP_IDE_CONFIG=serverName=laradock

### NodeJS VERSION #########################################

NODE_VERSION=10

### Windows Path ##########################################

# A fix for Windows users, to ensure the application path works
Expand Down Expand Up @@ -205,6 +209,12 @@ PHP_WORKER_INSTALL_GMP=false
PHP_WORKER_PUID=1000
PHP_WORKER_PGID=1000

### NODEJS ###############################################

# visit https://www.iana.org/time-zones

NODE_TZ=UTC

### NGINX #################################################

NGINX_HOST_HTTP_PORT=80
Expand Down
14 changes: 14 additions & 0 deletions nodejs/Dockerfile
@@ -0,0 +1,14 @@
ARG LARADOCK_NODE_VERSION=latest
FROM node:${LARADOCK_NODE_VERSION}-alpine

LABEL maintainer="Huadong Zuo <admin@zuohuadong.cn>"

RUN apk --no-cache add tzdata ca-certificates && npm install pm2@latest -g

WORKDIR /var/www/

EXPOSE 3000-3010

CMD ["pm2-runtime", "npm","--","start"]