-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update Dockerfile to remove backend folder and optimize image …
…size
- Loading branch information
Showing
4 changed files
with
42 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
npm-debug.log |
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
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,11 +1,23 @@ | ||
# Use an official Node.js runtime as a parent image | ||
FROM node:16 | ||
|
||
FROM node:14 AS build-stage | ||
# Set the working directory in the container | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install dependencies | ||
RUN npm install | ||
COPY . . | ||
|
||
# Build your app for production | ||
RUN npm run build | ||
FROM nginx:alpine | ||
COPY --from=build-stage /app/dist /usr/share/nginx/html | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] | ||
|
||
# Install a simple HTTP server to serve your static content | ||
RUN npm install -g http-server | ||
|
||
# Make port 8080 available to the world outside this container | ||
EXPOSE 8080 | ||
|
||
# Serve the app | ||
CMD ["http-server", "dist", "-p 8080"] |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
export DOCKER_BUILDKIT=1 | ||
|
||
# Name of your Docker application | ||
APP_NAME="vuetify-app" | ||
|
||
# Stop the currently running container | ||
docker stop $APP_NAME | ||
|
||
# Remove the stopped container | ||
docker rm $APP_NAME | ||
|
||
# Build the new Docker image | ||
docker build -t $APP_NAME . | ||
|
||
# Run the new Docker container | ||
docker run -d --name $APP_NAME -p 8080:82 $APP_NAME | ||
|
||
cd .. | ||
rm -rf ./backend |