Skip to content

Commit

Permalink
docker compose modified with volume for node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Dec 7, 2023
1 parent 1395986 commit 3e03d19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
17 changes: 5 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
version: '3.8'

networks:
my-app-network:
external: true

services:

beacon-network-frontend:
build:
context: ./frontend
#command: ["yarn"]
#command: ["node", "/opt/yarn-v1.22.19/bin/yarn.js", "start" ]
command: yarn start
container_name: beacon-network-frontend
command: node /opt/yarn-v1.22.19/bin/yarn.js start
container_name: bn-ui
environment:
- CHOKIDAR_USEPOLLING=true
ports:
- 3000:3000
- 3015:3000
stdin_open: true
volumes:
- ./frontend:/usr/src/app
networks:
- my-app-network
- ./frontend/:/frontend/
- /frontend/node_modules
6 changes: 4 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM node:19.0-alpine

# set working directory
WORKDIR /usr/src/app
WORKDIR /frontend

# add _/usr/src/app/node_modules/.bin_ to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
ENV PATH /frontend/node_modules/.bin:$PATH

# install app dependencies
COPY package.json .
COPY yarn.lock .

RUN yarn install --production


0 comments on commit 3e03d19

Please sign in to comment.