ci: update docker file
This commit is contained in:
parent
f346241e5c
commit
78aa85dc20
|
@ -1,18 +0,0 @@
|
||||||
run-name: ${{ gitea.actor }}, deploy with ssh
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Rebuild docker compose
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
key: ${{ secrets.KEY }}
|
|
||||||
script: |
|
|
||||||
cd /home/log101/prod/log101.dev-services
|
|
||||||
git pull
|
|
||||||
docker compose up -d --build
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.22.3
|
FROM golang:1.22.3-alpine as builder
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
@ -7,6 +7,10 @@ COPY go.mod go.sum ./
|
||||||
RUN go mod download && go mod verify
|
RUN go mod download && go mod verify
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go build -v -o /usr/local/bin ./...
|
RUN go build -v -o log101-dot-dev-services
|
||||||
|
|
||||||
CMD ["log101-blog-services"]
|
FROM alpine
|
||||||
|
WORKDIR /root/app
|
||||||
|
COPY --from=builder /usr/src/app .
|
||||||
|
|
||||||
|
CMD ["./log101-dot-dev-services"]
|
||||||
|
|
1
main.go
1
main.go
|
@ -68,6 +68,7 @@ func countEmojis(postId string) ([]EmojiCount, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Load environment variables
|
||||||
err := godotenv.Load()
|
err := godotenv.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error loading .env file")
|
log.Fatal("Error loading .env file")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user