feat: set env
This commit is contained in:
parent
329610088d
commit
2947743d28
|
|
@ -12,7 +12,9 @@ RUN npm ci
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the app
|
# Build the app with environment variables
|
||||||
|
ARG REACT_APP_API_BASE_URL
|
||||||
|
ENV REACT_APP_API_BASE_URL=$REACT_APP_API_BASE_URL
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,15 @@ services:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL}
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
# Add your environment variables here
|
- REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL}
|
||||||
# - REACT_APP_API_URL=http://api.example.com
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue