-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,137 additions
and
101 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,3 @@ | ||
node_modules | ||
.git | ||
.github |
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,6 +1,7 @@ | ||
PORT=5000 | ||
NODE_ENV="development" | ||
JWT_SECRET="thisismysupersecrettokenjustkidding" | ||
DATABASE_URL="mongodb://localhost:27017/donut-development" | ||
SENDGRID_API_KEY = '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' | ||
SOCKET_PORT = 8810 | ||
DATABASE_URL="mongodb://mongo:27017/donut-development" | ||
SENDGRID_API_KEY='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' | ||
SOCKET_PORT=8810 | ||
clientbaseurl = "http://localhost:3000/" |
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,39 @@ | ||
name: donut-server-image-ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- development | ||
|
||
tags: | ||
- v* | ||
|
||
env: | ||
IMAGE_NAME: donut-server:latest | ||
REPO_NAME: codeuino1 | ||
REGISTRY_NAME: registry.hub.docker.com | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: docker build . --file Dockerfile.prod --tag $IMAGE_NAME | ||
|
||
- name: Log into registry | ||
run: docker login --username {{ secrets.DOCKER_USERNAME }} --password {{ secrets.DOCKER_PASSWORD }} | ||
- name: Push image | ||
run: | | ||
IMAGE_ID=$REGISTRY_NAME/$REPO_NAME/$IMAGE_NAME | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:latest | ||
docker push $IMAGE_ID:$VERSION |
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,21 @@ | ||
FROM node:14 | ||
|
||
ENV NODE_ENV="development" | ||
|
||
# Copy package.json file into container | ||
COPY package.json package.json | ||
COPY package-lock.json package-lock.json | ||
|
||
# Install node modules | ||
RUN npm install && \ | ||
npm install --only=dev && \ | ||
npm cache clean --force --loglevel=error | ||
|
||
# Volume to mount source code into container | ||
VOLUME [ "/server" ] | ||
|
||
# move to the source code directory | ||
WORKDIR /server | ||
|
||
# Start the server | ||
CMD mv ../node_modules . && npm run dev |
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,16 @@ | ||
FROM node:14 | ||
|
||
ENV NODE_ENV="production" | ||
|
||
WORKDIR /server | ||
|
||
RUN git clone https://github.com/codeuino/social-platform-donut-backend.git | ||
|
||
WORKDIR /server/social-platform-donut-backend | ||
|
||
RUN npm install && \ | ||
npm install pm2@latest -g && \ | ||
npm cache clean --force --loglevel=error | ||
|
||
# Start the server | ||
CMD [ "pm2", "start", "./bin/www", "--time", "--no-daemon" ] |
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
Oops, something went wrong.