File tree 8 files changed +15824
-12355
lines changed
8 files changed +15824
-12355
lines changed Original file line number Diff line number Diff line change
1
+ # See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2
+
3
+ name : Fly Deploy
4
+ on :
5
+ push :
6
+ branches :
7
+ - main
8
+ jobs :
9
+ deploy :
10
+ name : Deploy app
11
+ runs-on : ubuntu-latest
12
+ concurrency : deploy-group # optional: ensure only one action runs at a time
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - uses : superfly/flyctl-actions/setup-flyctl@master
16
+ - run : flyctl deploy --remote-only
17
+ env :
18
+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
Original file line number Diff line number Diff line change
1
+ FROM node:22.6.0 as node
2
+
3
+ WORKDIR /app/ui
4
+ COPY ui/package-lock.json ./package-lock.json
5
+ COPY ui/package.json ./package.json
6
+ RUN npm ci
7
+
8
+ COPY ui /app/ui
9
+ RUN npm run build
10
+
11
+ FROM golang:1.23 as api
12
+
13
+ WORKDIR /app
14
+ COPY api/go.mod api/go.sum ./
15
+ RUN go mod download
16
+ COPY api /app
17
+ RUN CGO_ENABLED=0 go build
18
+
1
19
FROM alpine:3.7
2
20
3
- COPY api/api /api
4
- COPY ui/build /ui/build
21
+ COPY --from= api /app /api /api
22
+ COPY --from=node /app/ ui/build /ui/build
5
23
6
24
RUN chmod +x /api
7
25
Original file line number Diff line number Diff line change 1
1
REGISTRY =docker.pkg.github.com/elwin
2
2
VERSION =latest
3
3
4
- build-ui :
5
- cd ui; npm run build;
6
-
7
- build-api :
8
- cd api; GOOS=linux GOARCH=amd64 go build;
9
-
10
- build : build-api build-ui
4
+ build :
11
5
docker build . -t chat
12
6
13
7
publish : build
14
8
docker tag chat $(REGISTRY ) /chat/chat:$(VERSION )
15
9
docker push $(REGISTRY ) /chat/chat:$(VERSION )
10
+
11
+ run : build
12
+ docker run -p 8888:8888 chat
Original file line number Diff line number Diff line change
1
+ # fly.toml app configuration file generated for chat-ws on 2024-08-16T09:31:12+02:00
2
+ #
3
+ # See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4
+ #
5
+
6
+ app = ' chat-ws'
7
+ primary_region = ' ams'
8
+
9
+ [build ]
10
+
11
+ [http_service ]
12
+ internal_port = 8888
13
+ force_https = true
14
+ auto_stop_machines = ' suspend'
15
+ auto_start_machines = true
16
+ min_machines_running = 0
17
+ processes = [' app' ]
18
+
19
+ [[http_service .checks ]]
20
+ grace_period = " 10s"
21
+ interval = " 30s"
22
+ method = " GET"
23
+ timeout = " 5s"
24
+ path = " /"
25
+
26
+ [[vm ]]
27
+ memory = ' 512mb'
28
+ cpu_kind = ' shared'
29
+ cpus = 1
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments