Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
ADDED: docker file, pipeline, docker compose and docker ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
AleixMT committed Jan 23, 2024
1 parent e09081e commit a0a7632
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build
.dockerignore
Dockerfile
Dockerfile.prod
23 changes: 22 additions & 1 deletion .github/workflows/CI-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,30 @@ env:
on:
push:
branches:
- main
- "master"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/book-a-book-frontend:latest

Deploy-Production:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/book-a-book-frontend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# pull official base image
FROM node:13.12.0-alpine as build

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install #--silent
RUN npm install [email protected] -g #--silent

# add app
COPY . ./

# build app
RUN npm run build


# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
version: "2.1"
services:
book-a-book-buscador:
image: aleixmt/book-a-book-frontend:latest
pull_policy: always
ports:
- "0.0.0.0:80:80"

0 comments on commit a0a7632

Please sign in to comment.