Browse Source

init-repo

pull/2/head
fedy95 5 years ago
parent
commit
d678017aff
  1. 8
      .editorconfig
  2. 7
      Dockerfile
  3. 19
      LICENSE
  4. 15
      Makefile
  5. 15
      app/main.go
  6. 12
      docker-compose.yml

8
.editorconfig

@ -0,0 +1,8 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

7
Dockerfile

@ -0,0 +1,7 @@
FROM golang:alpine as golang
COPY ./app /app
WORKDIR /app
RUN go build -o main .
CMD ["/app/main"]

19
LICENSE

@ -1,19 +0,0 @@
MIT License Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

15
Makefile

@ -0,0 +1,15 @@
MAKEFLAGS += --silent
.PHONY: *
build:
docker-compose -f docker-compose.yml build
start: build
docker-compose -f docker-compose.yml up -d
down:
docker-compose -f docker-compose.yml down
restart: down start
.DEFAULT_GOAL := restart

15
app/main.go

@ -0,0 +1,15 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Go app is worked!")
})
log.Fatal(http.ListenAndServe(":7070", nil))
}

12
docker-compose.yml

@ -0,0 +1,12 @@
version: "3.8"
services:
rss-aggregator:
build:
context: .
restart: always
container_name: rss-aggregator
hostname: rss-aggregator
ports:
- "7070:7070"
Loading…
Cancel
Save