Skip to content

Commit

Permalink
.env file in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
hppanpaliya committed Nov 13, 2023
1 parent 0023323 commit 44599c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ RUN apt-get update && \
# Clone the repository
RUN git clone https://github.com/hppanpaliya/React-TrashMail

# Set arguments for environment variables
ARG REACT_APP_API_URL
ARG REACT_APP_DOMAINS

# Check if REACT_APP_DOMAINS is set
RUN if [ -z "$REACT_APP_DOMAINS" ] ; then echo "REACT_APP_DOMAINS argument not provided" && exit 1; fi

# Create .env file
RUN echo "REACT_APP_API_URL=$REACT_APP_API_URL\nREACT_APP_DOMAINS=$REACT_APP_DOMAINS" > /React-TrashMail/react/.env

# Build the React project
WORKDIR /React-TrashMail/react
RUN yarn && \
Expand Down

0 comments on commit 44599c0

Please sign in to comment.