File tree Expand file tree Collapse file tree 5 files changed +52
-10
lines changed
Expand file tree Collapse file tree 5 files changed +52
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Use an official Node.js runtime as a parent image
12FROM node:21.7.2
23
4+ # Set the working directory inside the container
35WORKDIR /root/bem-web
4- COPY . /root/bem-web
5- RUN cd /root/bem-web
6- RUN npm i
76
7+ # Copy the package.json and package-lock.json files first to leverage Docker cache
8+ COPY package.json ./
9+ COPY package-lock.json ./
10+
11+ # Install dependencies
12+ RUN npm install
13+
14+ # Copy the rest of the application code
15+ COPY . .
16+
17+ # Ensure the environment variables are available at build time (optional)
18+ # ARG REACT_APP_API_BASE_URL
19+ # ARG REACT_APP_API_PORT
20+ # ARG REACT_APP_ENV
21+ # ARG SPECIES_LINK_KEY
22+
23+ # Build the app for production
24+ RUN npm run build
25+
26+ # Expose the port on which the app will run
827EXPOSE 3000
928
10- CMD ["npm" , "start" ]
29+ # Start the application
30+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change @@ -15,5 +15,8 @@ Certifique de possuir [node v21.7.2](https://nodejs.org/en/download)
1515## Contêiner
1616Certifique de possuir [ Docker] ( https://docs.docker.com/desktop/ )
17171 . Clonar o repositório
18- 2 . Acessar o diretório da aplicação e executar o comando ` docker build -t bem-web . `
19- 3 . Com a imagem criada inicialize o contêiner com o comando ` docker run -d -p 3000:3000 bem-web `
18+
19+ > [ !IMPORTANT]
20+ > Renomeie o arquivo ` RENAME_TO_DOTENV.md ` para ` .env `
21+
22+ 2 . Inicialize o container com ` docker compose up --build `
Original file line number Diff line number Diff line change 1+ REACT_APP_API_BASE_URL=http://127.0.0.1
2+ REACT_APP_API_PORT=80
3+ REACT_APP_ENV=dev
4+ SPECIES_LINK_KEY=VjSPRSjDJKAdk8ojl3PR
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ bem-web :
5+ build : .
6+ ports :
7+ - " 3000:3000"
8+ environment :
9+ REACT_APP_API_BASE_URL : ${REACT_APP_API_BASE_URL}
10+ REACT_APP_API_PORT : ${REACT_APP_API_PORT}
11+ REACT_APP_ENV : ${REACT_APP_ENV}
12+ SPECIES_LINK_KEY : ${SPECIES_LINK_KEY}
13+ env_file :
14+ - .env
15+ volumes :
16+ - .:/root/bem-web
17+ - /root/bem-web/node_modules
18+ stdin_open : true
19+ tty : true
You can’t perform that action at this time.
0 commit comments