basic template

This commit is contained in:
BENEDEK László 2024-10-10 17:34:48 +02:00
commit ed1d4d1ca9
8 changed files with 96 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode
.idea

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM golang:1.23 AS build
COPY . /build
WORKDIR /build
RUN CGO_ENABLED=0 go build -o /build/app
FROM scratch
COPY --from=build /build/app /app
EXPOSE 5000
ENTRYPOINT [ "/app" ]

19
default.conf.template Normal file
View File

@ -0,0 +1,19 @@
server {
listen ${NGINX_PORT};
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ api\/?.* {
proxy_pass http://backend:5000;
}
}

42
docker-compose.yml Normal file
View File

@ -0,0 +1,42 @@
services:
db:
image: postgres:17-bookworm
ports:
- 5432:5432
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: szoe
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pgdata:/var/lib/postgresql/data
adminer:
image: adminer
ports:
- 8080:8080
depends_on:
- db
nginx:
image: nginx:1.27-alpine-slim
ports:
- 80:80
environment:
NGINX_PORT: 80
volumes:
- ./default.conf.template:/etc/nginx/templates/default.conf.template:ro
- ./static:/usr/share/nginx/html:ro
backend:
image: dowerx/szoe
build:
context: .
dockerfile: Dockerfile
tags:
- dowerx/szoe
depends_on:
- db
volumes:
pgdata:

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module git.tek.govt.hu/dowerx/szoe-pontok
go 1.23.0

5
main.go Normal file
View File

@ -0,0 +1,5 @@
package main
func main() {
}

1
static/404.html Normal file
View File

@ -0,0 +1 @@
<h1>404 :c</h1>

11
static/index.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SZOE pontok</title>
</head>
<body>
<h1>SZOE pontok</h1>
</body>
</html>