diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml new file mode 100644 index 00000000..df1aa7e5 --- /dev/null +++ b/.github/workflows/vue.yml @@ -0,0 +1,24 @@ +name: build and push to docker hub +on: + push: + branches: + - omar +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: omar8magdy + password: "${{ secrets.DOCKERHUB_TOKEN }}" + + - name: Build Docker image + run: | + docker build -t omar . + docker tag omar omar8magdy/vue-test:omar + docker push omar8magdy/vue-test:omar + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..21f3210a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use the official Node.js image as the base image +FROM node:22.2.0 + +# Set the working directory inside the container +WORKDIR /app + +# Copy the package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install the dependencies +RUN npm install + +# Copy the rest of the application files to the working directory +COPY . . + +# Build the Vue.js application for production +RUN npm run build + +# Expose port 80 +EXPOSE 80 + +# Define the command to run your application +CMD ["node", "start"]