go backend (#1)

Reviewed-on: yw5n/yw5ncom#1
This commit is contained in:
ange 2024-09-28 16:16:52 +00:00
parent e87932e375
commit 1e228ed338
10 changed files with 105 additions and 34 deletions

View file

@ -1,4 +1,10 @@
FROM docker.io/nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY html/ /usr/share/nginx/html/
COPY static/ /usr/share/nginx/static/
FROM docker.io/golang:1.23 as build
COPY src/ .
RUN printf 'module yw5n\ngo 1.23' > go.mod && CGO_ENABLED=0 go build -o /app
FROM scratch
COPY --from=build /app /app
COPY static/ /static/
COPY html/ /html/
EXPOSE 3000
CMD ["/app"]