我可以帮助您翻译以下内容:
我有一个使用docker-compose.yml文件加载的nginx和客户端镜像。由于某种原因,当应用程序运行时,环境变量(REACT_APP_MAXIMUM_CAMERAS_COUNT)不可见(我得到undefined),我无法弄清楚为什么。
这是我的create-react-app Dockerfile:
FROM node:alpine as builder
WORKDIR /app
COPY ./package.json ./
RUN npm i
COPY . .
RUN npm run build
FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html
version: '3'
services:
nginx:
image: <ip_address>:5000/orassayag/osr_streamer_nginx:v1.0
restart: always
ports:
- '3050:80'
client:
image: <ip_address>:5000/orassayag/osr_streamer_client:v1.0
environment:
- REACT_APP_MAXIMUM_CAMERAS_COUNT=10