This commit is contained in:
Zeev Diukman 2024-09-10 21:41:52 +03:00
commit ad94e6784e
5 changed files with 53 additions and 0 deletions

27
docker-compose.yml Normal file
View file

@ -0,0 +1,27 @@
services:
app:
build:
dockerfile: Dockerfile
context: .
target: dev
volumes:
- ./go:/opt/app
hostname: dev
expose:
- 53
- 53/udp
- 80
ports:
- 53
- 53/udp
- 80
networks:
zbr:
ipv4_address: 10.10.10.10
networks:
zbr:
driver: bridge
ipam:
config:
- subnet: 10.10.10.0/24
gateway: 10.10.10.1

8
dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM golang:1.23 AS base
FROM base AS dev
RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
WORKDIR /opt/app
CMD ["air"]

3
go/go.mod Normal file
View file

@ -0,0 +1,3 @@
go 1.23
module github.com/zeevdiukman/docker-go-boilerplate

7
go/main.go Normal file
View file

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("MAIN")
}

8
z.code-workspace Normal file
View file

@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}