1
0
mirror of https://github.com/antonmedv/fx synced 2024-07-01 07:04:41 +00:00

Add docker

This commit is contained in:
Anton Medvedev 2024-03-11 11:41:41 +01:00
parent a079be1eea
commit 14e1bd8f5f
No known key found for this signature in database
2 changed files with 50 additions and 0 deletions

27
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: docker
on: [workflow_dispatch]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: antonmedv
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: antonmedv/fx:latest

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM golang:latest as builder
WORKDIR /go
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o fx .
FROM alpine
RUN apk add --update nodejs
COPY --from=builder /go/fx /bin/fx
WORKDIR /data
ENV COLORTERM=truecolor
ENTRYPOINT ["/bin/fx"]