diff --git a/Dockerfile b/Dockerfile index 506bfdf..3f3d1de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ FROM jess/inkscape -RUN apt-get update && apt-get install -y python-lxml python-numpy +RUN apt-get update && apt-get install -y python-lxml python-numpy wget + +RUN wget https://golang.org/dl/go1.16.2.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.2.linux-amd64.tar.gz && ln -s /usr/local/go/bin/go /usr/local/bin/go && go version WORKDIR /app -RUN apt-get update && apt-get install -y golang -ADD main.go . +ADD main.go index.html ./ RUN go build -o main main.go ENTRYPOINT ["/app/main"] diff --git a/Makefile b/Makefile index 2f8b07f..d2c3302 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ build: lint check-format fetch-deps .PHONY: docker-build # Build the docker image docker-build: - @docker build build --tag $(IMAGE) . + @docker build --tag $(IMAGE) . .PHONY: docker-publish # Push the docker image to the remote registry docker-publish: @@ -39,7 +39,7 @@ docker-publish: .PHONY: run # Run the application run: docker-build - @docker run -it -p 8000:8080 $(IMAGE) + @docker run -it -p 8080:8080 $(IMAGE) .PHONY: ci # Perform CI specific tasks to perform on a pull request ci: diff --git a/README.md b/README.md index 7b16edb..e9d3f36 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# svg-to-dxf +![svg-to-dxf](logo.png) -Convert .svg files to .dxf +> Convert .svg files to .dxf + +Available at https://svg-to-dxf.cluster.fun/ ## Features -Runs a webserver that takes in an `?url=` query string, fetches the SVG from that URL and then returns it as a .dxf +Runs a webserver that takes in an `?url=` query string and fetches the SVG from that URL or an svg file uploaded and then returns it as a .dxf ## Usage diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..760a436 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module svg-to-dxf + +go 1.16 diff --git a/index.html b/index.html new file mode 100644 index 0000000..1ac5fe9 --- /dev/null +++ b/index.html @@ -0,0 +1,93 @@ + + +
+ + + ++ Convert .svg files to .dxf ++ +
+ Enter the URL of an SVG file and press convert to download the file as a .dxf
.
+
+ Upload an SVG file and press convert to download the file as a .dxf
.
+