Skip to content

Commit

Permalink
chore: new try
Browse files Browse the repository at this point in the history
  • Loading branch information
spantheslayer committed Nov 13, 2023
1 parent 1e178a0 commit 45051b4
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 144 deletions.
7 changes: 7 additions & 0 deletions .docker/scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "Applying Database Migrations"
/app/node_modules/.bin/prisma migrate deploy

echo "Starting Application"
node /app/lib/servers/graphql-main.js
33 changes: 33 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker image

on:
push:
branches:
- 'deployment-ci'

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/my-app:latest
71 changes: 0 additions & 71 deletions .github/workflows/ci.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/spinup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Spinup Server

on:
push:
branches: ['deployment-ci']

jobs:
spinup-server:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install direnv
run: sudo apt-get install direnv -y

- name: Install dependencies
run: yarn install

- name: Build the app
run: yarn build

- name: Run Server & Get Healthz
run: |
. ./.envrc && yarn start &
sleep 5
curl --fail http://localhost:4000/healthz
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
FROM node:18
FROM node:18 AS BUILD_IMAGE

WORKDIR /app

# Install dependencies
COPY *.json ./yarn.lock ./
COPY . .
RUN yarn install --frozen-lockfile

# Run Source Code
COPY . .
# Build Source Code
COPY ./src ./src
RUN yarn build
RUN yarn install --frozen-lockfile --production

FROM node:16
COPY --from=BUILD_IMAGE /app/lib /app/lib
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
COPY --from=BUILD_IMAGE /app/prisma /app/prisma
COPY --from=BUILD_IMAGE /app/.docker/scripts /app/.docker/scripts

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./default.yaml ./

CMD [".docker/scripts/start.sh"]
69 changes: 0 additions & 69 deletions eslintonld.json

This file was deleted.

0 comments on commit 45051b4

Please sign in to comment.