Skip to content

Commit

Permalink
fly deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnBakhmat committed Jan 16, 2024
1 parent 01f0e23 commit 88af21a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
/bin
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
/bin
23 changes: 8 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
FROM golang:1.19 AS build
WORKDIR /go/src/pinned
COPY . .
FROM golang:1.18-alpine
WORKDIR /usr/src/app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app .


FROM alpine:latest as release
WORKDIR /app
COPY --from=build /go/src/pinned/app .
RUN apk -U upgrade \
&& apk add --no-cache dumb-init ca-certificates \
&& chmod +x /app/app
EXPOSE 3000

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
COPY . .
RUN go build -o ./bin/pinned .
EXPOSE 8080
CMD [ "./bin/pinned" ]
22 changes: 22 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fly.toml app configuration file generated for pinned on 2024-01-16T12:03:37+03:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "pinned"
primary_region = "waw"

[build]

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

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 1024

0 comments on commit 88af21a

Please sign in to comment.