-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# Using node:20 for the vite to work correct. | ||
FROM node:20 | ||
# Use node to build | ||
FROM node:20 AS builder | ||
|
||
# Set the working directory in the container | ||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app. But remove the node_modules folder | ||
# Copy the files | ||
COPY . . | ||
|
||
# Remove the node_modules folder | ||
RUN rm -rf node_modules | ||
|
||
# Install any needed packages specified in package.json | ||
# Install dependencies and build the production app | ||
RUN npm install | ||
RUN npm run build | ||
|
||
# Use a lightweight web server | ||
FROM nginx:alpine | ||
|
||
# Make port 3000 available for the vite app | ||
EXPOSE 3000 | ||
# Copy the build output to NGINX's HTML directory | ||
COPY --from=builder /app/dist /usr/share/nginx/html | ||
|
||
# Define environment variable | ||
#ENV NODE_ENV=development | ||
ENV REACT_APP_API_BASE_URL=http://localhost:30002 | ||
ENV VITE_API_URL=http://165.227.166.132:30002 | ||
# Expose port 80 for the NGINX server | ||
EXPOSE 80 | ||
|
||
# Run the app when the container launches | ||
CMD ["npm", "run", "dev"] | ||
# Start NGINX | ||
CMD ["nginx", "-g", "daemon off;"] |