Good day,
I’m having issue when mounting local files to docker, but when docker restart it reflects.
See more details below:
Docker container file structure:
Dockerfile:
FROM node:latest
WORKDIR /app
COPY . ./
RUN npm cache clean --force
RUN npm install
RUN NODE_ENV=production npm run build
ENV PORT 2000
EXPOSE ${PORT}
ENTRYPOINT ["npm", "run", "dev"]
docker-compose.yml:
version: '3.8'
services:
reactjs:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
ports:
- "2000:2000"
depends_on:
- reactmysql
entrypoint: npm run dev
reactmysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: reactdb
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
reactphpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- '2080:80'
environment:
TZ: Asia/Manila
PMA_HOST: reactmysql
depends_on:
- reactmysql