Dockerfile.css
This commit is contained in:
parent
c695b86199
commit
272f60ea10
4 changed files with 37 additions and 11 deletions
27
.github/workflows/css-dev-docker.yml
vendored
Normal file
27
.github/workflows/css-dev-docker.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: Dev-to-docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: watchyourlan
|
||||||
|
TAGS: dev-css
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build and Push Docker Image to docker.io
|
||||||
|
uses: mr-smithers-excellent/docker-build-push@v5
|
||||||
|
with:
|
||||||
|
image: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: ${{ env.TAGS }}
|
||||||
|
registry: docker.io
|
||||||
|
dockerfile: Dockerfile.css
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
FROM golang:bullseye AS builder
|
FROM golang:bullseye AS builder
|
||||||
|
|
||||||
|
RUN cd / && git clone https://github.com/twbs/icons.git
|
||||||
|
RUN cd / && git clone https://github.com/thomaspark/bootswatch.git
|
||||||
|
|
||||||
COPY . /src
|
COPY . /src
|
||||||
|
|
||||||
RUN apt update && apt install -y npm
|
|
||||||
RUN cd / && npm i bootswatch > /dev/null 2>&1 \
|
|
||||||
&& npm i bootstrap-icons > /dev/null 2>&1
|
|
||||||
|
|
||||||
RUN cd /src/cmd/WatchYourLAN/ && CGO_ENABLED=0 go build -o /WatchYourLAN .
|
RUN cd /src/cmd/WatchYourLAN/ && CGO_ENABLED=0 go build -o /WatchYourLAN .
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,10 +12,13 @@ FROM alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache tzdata arp-scan \
|
RUN apk add --no-cache tzdata arp-scan \
|
||||||
&& mkdir /data
|
&& mkdir /data \
|
||||||
|
&& mkdir -p /app/css/bootswatch/dist \
|
||||||
|
&& mkdir -p /app/css/bootstrap-icons/font
|
||||||
|
|
||||||
COPY --from=builder /WatchYourLAN /app/
|
COPY --from=builder /WatchYourLAN /app/
|
||||||
COPY --from=builder /node_modules /app/
|
COPY --from=builder /icons/font /app/css/bootstrap-icons/font
|
||||||
|
COPY --from=builder /bootswatch/dist /app/css/bootswatch/dist
|
||||||
|
|
||||||
ENTRYPOINT ["./WatchYourLAN"]
|
ENTRYPOINT ["./WatchYourLAN"]
|
||||||
CMD ["-b", "/app/node_modules"]
|
CMD ["-b", "/app/css"]
|
||||||
2
Makefile
2
Makefile
|
|
@ -29,7 +29,7 @@ check: fmt lint
|
||||||
|
|
||||||
go-build:
|
go-build:
|
||||||
cd cmd/WatchYourLAN/ && \
|
cd cmd/WatchYourLAN/ && \
|
||||||
go build .
|
CGO_ENABLED=0 go build -o ../../tmp/WatchYourLAN .
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
docker build -t $(DUSER)/$(DNAME) .
|
docker build -t $(DUSER)/$(DNAME) .
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ const configPath = "/data/config"
|
||||||
|
|
||||||
const bootPath = ""
|
const bootPath = ""
|
||||||
|
|
||||||
// const bootPath = "/data/node_modules"
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
confPtr := flag.String("c", configPath, "Path to config file")
|
confPtr := flag.String("c", configPath, "Path to config file")
|
||||||
bootPtr := flag.String("b", bootPath, "Path to local Bootswatch")
|
bootPtr := flag.String("b", bootPath, "Path to local Bootswatch")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue