I’m trying to dockerize my react app.
But when I go to run it, it immediately stops. No errors.
Here is my docker-compose.yml file:
frontend:
build:
context: ../frontend
dockerfile: Dockerfile.react
ports:
- "3000:3000" # Map port 3000 on the host to 3000 in the container
volumes:
- ../frontend:/react-app
environment:
- REACT_APP_API_URL=http://localhost:3030
depends_on:
- apiserver
networks:
- mynetwork # Connect this service to the custom network
networks:
mynetwork:
And here is my Dockerfile:
FROM node:latest
WORKDIR /react-app
COPY package.json package.json
COPY public/ public
COPY src/ src
RUN npm install
EXPOSE 3000
CMD ["npm", "start"]
And finally, what shows up in the logs:
2023-09-23 02:51:14
2023-09-23 02:51:14 > [email protected] start
2023-09-23 02:51:14 > react-scripts start
2023-09-23 02:51:14
I’m at a loss. I’ve tried everything and have been searching for hours.
Any help would be greatly appreciated
Everything. Searched SOF for hours