Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize #18

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
cd:
runs-on: ubuntu-latest

steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Build and tag frontend image
working-directory: ./website
run: docker build -f Dockerfile.prod -t yashmeh/dalp-frontend:0.0.1 .

- name: Build and tag api image
working-directory: ./backend
run: docker build -t yashmeh/dalp-api:0.0.1 .

- name: Build and tag peer image
working-directory: ./backend/peerDocker
run: docker build -t yashmeh/dalp-peer:0.0.1 .

- name: Push the frontend image to docker hub
run: docker push yashmeh/dalp-frontend:0.0.1

- name: Push the api image to docker hub
run: docker push yashmeh/dalp-api:0.0.1

- name: Push the peer image to docker hub
run: docker push yashmeh/dalp-peer:0.0.1
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ npm run start

4. Go to [http://localhost:3000](http://localhost:3000) for the kick of awesomeness

## Run using docker

- Start the containers

```cmd
docker-compose up
```

Go to [http://localhost:3000](http://localhost:3000)

- Stop the containers

```cmd
docker-compose down
```

## Developed by

This platform is proudly made by team `unpaid_interns`
Expand Down
22 changes: 22 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#Using an alpine version of node
FROM node:8.7.0-alpine

#Create app directory and use it as the working directory
RUN mkdir -p /backend
WORKDIR /backend

#Copying the package files from localstorage to image
COPY package.json /backend
COPY package-lock.json /backend

#Installing dependencies
RUN npm install

#Copying all the files from localstorage to image
COPY . /backend

#Expose the port for standalone container
EXPOSE 8080

#Starting the server using nodemon
CMD ["npm","run","start"]
Loading