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