Writing backend uri to .env after copying contents and cleaning up after build.
This commit is contained in:
+8
-1
@@ -21,13 +21,20 @@ RUN useradd -s /bin/bash nonroot
|
|||||||
RUN mkdir -p /app
|
RUN mkdir -p /app
|
||||||
RUN chown -R nonroot:nonroot /app
|
RUN chown -R nonroot:nonroot /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copying contents
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN echo $BACKEND_URI > /app/.env
|
|
||||||
|
# Writing backend uri in .env
|
||||||
|
RUN echo "VITE_API_URL = $BACKEND_URI" > /app/.env
|
||||||
|
|
||||||
# Building frontend
|
# Building frontend
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Clean-up
|
||||||
|
RUN rm -rf eslint.config.js index.html node_modules/ package-lock.json package.json postcss.config.js public/ src/ tailwind.config.js vite.config.js .dockerignore .gitignore .vite/
|
||||||
|
|
||||||
# Install server
|
# Install server
|
||||||
RUN npm install -g serve
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user