Skip to content

Commit ff11861

Browse files
authored
Add deployment support (#12)
* fixes readme logo image * adds heroku deployment * optimizes docker build time
1 parent 5089053 commit ff11861

File tree

7 files changed

+56
-7
lines changed

7 files changed

+56
-7
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.yml
2+
*.yaml
3+
*.json
4+
*.md
5+
6+
.git*
7+
bin
8+
dist
9+
build
10+
docs
11+
examples
12+
tmp
13+
vendor
14+
15+
.editorconfig
16+
app.json
17+
Dockerfile
18+
CODEOWNERS
19+
LICENSE
20+
Makefile
21+
.env
22+
docker-compose.yml
23+
docker-compose.override.yml
24+
README.md

.goreleaser.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
env:
2+
- GO111MODULE=on
13
builds:
24
- main: cmd/serve/main.go
35
binary: serve
@@ -15,7 +17,6 @@ builds:
1517
goarch: 386
1618
env:
1719
- CGO_ENABLED=0
18-
- GO111MODULE=on
1920
ldflags:
2021
- -s -w -X main.version={{.Version}}
2122
archive:

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ LABEL maintainer="Chase Pierce <[email protected]>"
2020

2121
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2222
COPY --from=builder /go/src/github.com/syntaqx/serve/bin/serve /usr/bin/
23+
COPY --from=builder /go/src/github.com/syntaqx/serve/static /var/www
2324

2425
RUN addgroup -S serve \
2526
&& adduser -D -S -s /sbin/nologin -G serve serve

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: serve

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/syntaqx/serve.svg)][docker-hub]
2121
[![Docker Pulls](https://img.shields.io/docker/pulls/syntaqx/serve.svg)][docker-hub]
2222

23+
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https://github.com/syntaqx/serve/tree/master)
24+
2325
## TL;DR
2426

2527
> It's basically `python -m SimpleHTTPServer 8080` written in Go, because who
@@ -99,14 +101,13 @@ version: '3'
99101
services:
100102
web:
101103
image: syntaqx/serve
102-
build: .
103104
volumes:
104105
- ./static:/var/www
105106
- ./fixtures:/etc/ssl
106107
environment:
107-
- PORT=8888
108+
- PORT=1234
108109
ports:
109-
- 8888
110+
- 1234
110111
command: serve -ssl -cert=/etc/ssl/cert.pem -key=/etc/ssl/key.pem -dir=/var/www
111112
```
112113
@@ -159,10 +160,14 @@ sure you have the following installed:
159160
### Prerequisites
160161

161162
* [Git][git]
162-
* [Go 1.11][golang]+
163+
* [Go 1.11][golang]+ (with [`GO111MODULE`][modules] enabled)
164+
165+
### Tooling
166+
167+
* [pre-commit](https://pre-commit.com/)
163168

164-
You will need to activate [Modules][modules] for your version of Go, generally
165-
by invoking `go` with the support `GO111MODULE=on` environment variable set.
169+
> __Note__: While the tooling isn't explicitly required in order to build and
170+
> run the project, it's for everyone's benefit that you leverage it.
166171

167172
### Install
168173

app.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "serve",
3+
"description": "a static http server anywhere you need one",
4+
"repository": "https://github.com/syntaqx/serve",
5+
"logo": "https://raw.githubusercontent.com/syntaqx/serve/master/docs/logo.svg?sanitize=true",
6+
"keywords": [
7+
"go",
8+
"golang",
9+
"static",
10+
"simple-http-server",
11+
"file-server"
12+
],
13+
"stack": "container"
14+
}

heroku.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build:
2+
docker:
3+
web: Dockerfile

0 commit comments

Comments
 (0)