Skip to content

Commit

Permalink
mod:addedDocker
Browse files Browse the repository at this point in the history
  • Loading branch information
moshdev2213 committed Sep 7, 2024
1 parent 0660e09 commit 59c294b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Node modules should not be copied to the Docker image as they are re-installed during the build process.
node_modules
npm-debug.log
yarn-debug.log
yarn-error.log

# Exclude the local environment variables
.env
.env.local
.env.*.local

# Output directories
dist
build

# Exclude Dockerfile and Docker ignore file itself
Dockerfile
.dockerignore

# Ignore any git-related files
.git
.gitignore

# Exclude local development files and tools
.vscode
.idea
*.swp

# OS generated files
.DS_Store
Thumbs.db

# Logs and temporary files
*.log
*.tmp
33 changes: 33 additions & 0 deletions .github/workflows/docker_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Admin App Docker Build and Push

on:
push:
branches:
- master

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/apekade_admin:latest
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Node.js runtime as a parent image
FROM node:20-alpine

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the app
RUN npm run build

# Expose port 80
EXPOSE 5345

# Start nginx
CMD ["npm","run","dev"]

0 comments on commit 59c294b

Please sign in to comment.