Server init, removed some trash.

This commit is contained in:
Dejwut 2023-05-16 21:32:06 +02:00
parent c20b530c51
commit bbf1d0136b
8 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,17 @@
services:
nginx:
image: nginx:stable-alpine
container_name: "uwu-nginx"
ports:
- "8080:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/log/access.log:/var/log/nginx/access.log
- ./nginx/log/error.log:/var/log/nginx/error.log
restart: always
server:
container_name: "uwu-server"
build:
context: ./server
# env_file: .env
restart: always

View File

14
server/nginx/nginx.conf Normal file
View File

@ -0,0 +1,14 @@
events {}
http {
server {
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location /api/v1 {
proxy_pass http://server:10000;
}
}
}

11
server/server/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM golang:1.20.4-alpine3.18 AS builder
WORKDIR /go/src/server
COPY ./src .
RUN go build -o /app ./
FROM alpine:3.18.0
WORKDIR /go/src/server
COPY --from=builder /app ./
RUN chmod +x ./app
ENTRYPOINT ["./app"]

3
server/server/src/go.mod Normal file
View File

@ -0,0 +1,3 @@
module uwu
go 1.20

View File

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

1
uwu
View File

@ -1 +0,0 @@
Test ondrej novak