Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b49f985
Create deploy.yml
RorryKelly Sep 22, 2024
50bf286
test changes
RorryKelly Sep 22, 2024
e3f24d9
test changes
RorryKelly Sep 22, 2024
bbdb946
test changes
RorryKelly Sep 22, 2024
97635fe
test changes
RorryKelly Sep 22, 2024
dfd430a
test changes
RorryKelly Sep 22, 2024
3df1d2b
test changes
RorryKelly Sep 22, 2024
8cffcf3
test changes
RorryKelly Sep 22, 2024
3c7ab18
test changes
RorryKelly Sep 22, 2024
c858020
test changes
RorryKelly Sep 22, 2024
75bad3e
test
RorryKelly Sep 22, 2024
e4e1114
test
RorryKelly Sep 22, 2024
40db244
test
RorryKelly Sep 22, 2024
aad650f
test
RorryKelly Sep 22, 2024
a9fe076
test
RorryKelly Sep 24, 2024
e1696cf
test
RorryKelly Sep 24, 2024
ff172b7
test
RorryKelly Sep 24, 2024
503eb91
test
RorryKelly Sep 24, 2024
42ad8ed
test
RorryKelly Sep 24, 2024
5d1caa9
test
RorryKelly Sep 24, 2024
e377e02
test
RorryKelly Sep 26, 2024
cf2872b
test
RorryKelly Sep 26, 2024
47a937d
test
RorryKelly Sep 26, 2024
159ee10
test
RorryKelly Sep 26, 2024
e6d8abf
test
RorryKelly Sep 26, 2024
47a50c5
test
RorryKelly Sep 26, 2024
d81021e
gf
RorryKelly Oct 15, 2024
2ceee9a
test
RorryKelly Oct 19, 2024
ca2d9ab
test
RorryKelly Oct 19, 2024
105c952
test
RorryKelly Oct 19, 2024
f1ce5ae
test
RorryKelly Oct 19, 2024
f89356c
test
RorryKelly Oct 19, 2024
29fb4cf
test
RorryKelly Oct 19, 2024
aadf5c1
test
RorryKelly Oct 19, 2024
07b0571
test
RorryKelly Oct 19, 2024
ee1a39a
test
RorryKelly Oct 19, 2024
fe56032
test
RorryKelly Oct 19, 2024
f3f17c0
test
RorryKelly Oct 19, 2024
fff0b4b
test
RorryKelly Oct 19, 2024
99f8f83
test
RorryKelly Oct 19, 2024
4a29209
test
RorryKelly Oct 19, 2024
75ae0b0
test
RorryKelly Oct 19, 2024
2fa6135
test
RorryKelly Oct 19, 2024
59a09f5
test
RorryKelly Oct 19, 2024
8b1f7a5
test
RorryKelly Oct 19, 2024
008aeb8
test
RorryKelly Oct 20, 2024
9e5166f
test
RorryKelly Oct 20, 2024
b22c1d2
test
RorryKelly Oct 22, 2024
e4a4599
test
RorryKelly Oct 22, 2024
12c5cb8
test
RorryKelly Oct 22, 2024
b2c7ddb
test
RorryKelly Oct 22, 2024
8734742
test
RorryKelly Oct 22, 2024
e262f92
test
RorryKelly Oct 22, 2024
d724d3c
test
RorryKelly Oct 22, 2024
4cd85c2
test
RorryKelly Oct 22, 2024
abad24d
test
RorryKelly Oct 22, 2024
715b4f7
test
RorryKelly Oct 22, 2024
be95d08
test
RorryKelly Oct 22, 2024
66ab77d
test
RorryKelly Oct 22, 2024
f729399
test
RorryKelly Oct 22, 2024
aea171b
test
RorryKelly Oct 22, 2024
c3f9b96
test
RorryKelly Oct 26, 2024
1a1d533
test
RorryKelly Oct 26, 2024
6624c77
test
RorryKelly Oct 26, 2024
9980265
test
RorryKelly Oct 26, 2024
0ee262a
test
RorryKelly Oct 26, 2024
e8230f1
test
RorryKelly Oct 26, 2024
fdf469a
test
RorryKelly Oct 27, 2024
58510e1
test
RorryKelly Oct 27, 2024
607d22c
test
RorryKelly Oct 27, 2024
a261529
test
RorryKelly Oct 27, 2024
7d834ae
test
RorryKelly Oct 27, 2024
901755d
update gitignore
RorryKelly Nov 4, 2024
f26bfe5
add file flag
RorryKelly Nov 4, 2024
67ec5ca
test
RorryKelly Nov 4, 2024
840d2a0
test
RorryKelly Nov 4, 2024
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
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & Publish Docker Image

on:
push:
branches:
- RorryKelly-patch-1

jobs:
build:
name: Build & push docker image
runs-on: ubuntu-latest
env:
IMG_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Check Secrets
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
if: env.DOCKER_USERNAME != null
run: echo "$DOCKER_USERNAME"

- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
run: |
ls
docker compose -f ./docker/prod/compose.yaml build
docker tag remote-flow-remoteflow ${{ secrets.DOCKER_USERNAME }}/remote-flow-remoteflow:latest
docker push ${{ secrets.DOCKER_USERNAME }}/remote-flow-remoteflow:latest

docker tag remote-flow-chat-server ${{ secrets.DOCKER_USERNAME }}/remote-flow-chat-server:latest
docker push ${{ secrets.DOCKER_USERNAME }}/remote-flow-chat-server:latest

- name: Install SSH Key
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Deploy Docker image to EC2
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_INSTANCE_IP }} << 'EOF'
docker pull ${{ secrets.DOCKER_USERNAME }}/remote-flow-remoteflow:latest
docker pull ${{ secrets.DOCKER_USERNAME }}/remote-flow-chat-server:latest
docker stop $(docker ps -a -q) || true
docker run -d -p 3000:3000 ${{ secrets.DOCKER_USERNAME }}/remote-flow-remoteflow:latest
docker run -d -p 1324:1324 ${{ secrets.DOCKER_USERNAME }}/remote-flow-chat-server:latest
EOF
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

local.env
4 changes: 2 additions & 2 deletions chat-server/DockerFile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specify the base image
FROM node:18-alpine
#!/bin/bash
FROM node:18

# Set the working directory inside the container
WORKDIR /usr/src/app
Expand Down
60 changes: 2 additions & 58 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,2 @@
name: RemoteFlow
services:
remoteflow:
build:
context: .
args:
- API_URL=
- AUTH_GOOGLE_ID=
- AUTH_GOOGLE_SECRET=
- AUTH_SECRET=
- AUTH_TRUST_HOST=
- MONGODB_URI=
environment:
- API_URL=
- AUTH_GOOGLE_ID=
- AUTH_GOOGLE_SECRET=
- AUTH_SECRET=
- AUTH_TRUST_HOST=
- MONGODB_URI=
ports:
- 3000:3000
networks:
- remoteflow-network
depends_on:
- mongo
chat-server:
build:
context: ./chat-server
dockerfile: DockerFile
args:
- MONGODB_URI=
environment:
- MONGODB_URI=
ports:
- 1324:1324
networks:
- remoteflow-network
depends_on:
- mongo
mongo:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
networks:
- remoteflow-network
volumes:
- remoteflow-database:/home/node/app

volumes:
remoteflow-database:

networks:
remoteflow-network:
driver: bridge
include:
- ./docker/dev/compose.yaml
23 changes: 23 additions & 0 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
FROM node:18

ARG API_URL
ARG AUTH_GOOGLE_ID
ARG AUTH_GOOGLE_SECRET
ARG AUTH_SECRET
ARG AUTH_TRUST_HOST
ARG MONGODB_URI

WORKDIR /app
COPY ../../package*.json ./
RUN npm install
COPY ../../ .
EXPOSE 3000
ENV API_URL ${API_URL}
ENV AUTH_GOOGLE_ID ${AUTH_GOOGLE_ID}
ENV AUTH_GOOGLE_SECRET ${AUTH_GOOGLE_SECRET}
ENV AUTH_SECRET ${AUTH_SECRET}
ENV AUTH_TRUST_HOST ${AUTH_TRUST_HOST}
ENV MONGODB_URI ${MONGODB_URI}
RUN npm run build
CMD npm run dev
54 changes: 54 additions & 0 deletions docker/dev/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3.8'

services:
remoteflow:
env_file:
- path: ../../local.env
build:
context: ../..
dockerfile: ./docker/dev/Dockerfile
args:
- API_URL=${API_URL:-http://localhost:3000}
- AUTH_GOOGLE_ID=${AUTH_GOOGLE_ID:-default-google-id}
- AUTH_GOOGLE_SECRET=${AUTH_GOOGLE_SECRET:-default-google-secret}
- AUTH_SECRET=${AUTH_SECRET:-default-auth-secret}
- AUTH_TRUST_HOST=${AUTH_TRUST_HOST:-false}
- MONGODB_URI=${MONGODB_URI:-mongodb://mongo:27017}
ports:
- 3000:3000
networks:
- remoteflow-network
depends_on:
- mongo

chat-server:
env_file:
- path: ../../local.env
build:
context: ../../chat-server
dockerfile: Dockerfile
args:
- MONGODB_URI=${MONGODB_URI:-mongo://localhost:27017}
ports:
- 1324:1324
networks:
- remoteflow-network
depends_on:
- mongo

mongo:
image: mongo:latest
container_name: mongo
ports:
- "27017:27017"
networks:
- remoteflow-network
volumes:
- remoteflow-database:/home/node/app

volumes:
remoteflow-database:

networks:
remoteflow-network:
driver: bridge
3 changes: 2 additions & 1 deletion Dockerfile → docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
FROM node:18

ARG API_URL
Expand All @@ -19,4 +20,4 @@ ENV AUTH_SECRET ${AUTH_SECRET}
ENV AUTH_TRUST_HOST ${AUTH_TRUST_HOST}
ENV MONGODB_URI ${MONGODB_URI}
RUN npm run build
CMD npm run dev
CMD npm run start
50 changes: 50 additions & 0 deletions docker/prod/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3.8'

services:
remoteflow:
build:
context: ../..
dockerfile: ./docker/prod/Dockerfile
args:
- API_URL=${API_URL:-http://localhost:3000}
- AUTH_GOOGLE_ID=${AUTH_GOOGLE_ID:-default-google-id}
- AUTH_GOOGLE_SECRET=${AUTH_GOOGLE_SECRET:-default-google-secret}
- AUTH_SECRET=${AUTH_SECRET:-default-auth-secret}
- AUTH_TRUST_HOST=${AUTH_TRUST_HOST:-false}
- MONGODB_URI=${MONGODB_URI:-mongodb://mongo:27017}
ports:
- 3000:3000
networks:
- remoteflow-network
depends_on:
- mongo

chat-server:
build:
context: ../../chat-server
dockerfile: Dockerfile
args:
- MONGODB_URI=${MONGODB_URI:-mongo://localhost:27017}
ports:
- 1324:1324
networks:
- remoteflow-network
depends_on:
- mongo

mongo:
image: mongo:latest
container_name: mongo
ports:
- "27017:27017"
networks:
- remoteflow-network
volumes:
- remoteflow-database:/home/node/app

volumes:
remoteflow-database:

networks:
remoteflow-network:
driver: bridge
Binary file added public/assets/reiboot_11727523955636185901.exe
Binary file not shown.