Skip to content

Commit

Permalink
Merge pull request #163 from kossiitkgp/deployment
Browse files Browse the repository at this point in the history
Implement Docker Setup and GitHub Actions for Fly Deployment
  • Loading branch information
harshkhandeparkar authored Nov 13, 2023
2 parents ab82cbf + 1206863 commit 5c0c2e9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.19-alpine

WORKDIR /app

COPY . /app

RUN apk add build-base

RUN go build -o app ./cmd/backend.go

EXPOSE 8080

CMD ["./app"]
20 changes: 20 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# fly.toml app configuration file generated for kwoc-backend on 2023-11-10T01:32:04+05:30
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "kwoc-backend"
primary_region = "sin"


[env]
BACKEND_PORT = "8080"
DEV = "false"

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

0 comments on commit 5c0c2e9

Please sign in to comment.