diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..46f8598 --- /dev/null +++ b/dockerfile @@ -0,0 +1,23 @@ +# syntax=docker/dockerfile:1 +FROM golang:1.17.0-bullseye as builder +WORKDIR /app +# Set build architecture +ENV GOOS linux +ENV CGO_ENABLED 0 +# Install dependencies +COPY go.mod go.sum ./ +RUN go mod download +# Copy the source code +COPY . . +# build app +RUN go build -o build.out + +FROM alpine:3.14 as runner +WORKDIR /app +# Add certificates +RUN apk add --no-cache ca-certificates +# Copy the app from the builder stage +COPY --from=builder /app/build.out /app/build.out +# Expose port +EXPOSE 60003/udp +CMD /app/build.out diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..62963d2 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/PretendoNetwork/super-mario-maker-secure + +go 1.17 + +require ( + github.com/PretendoNetwork/nex-go v0.0.0-20210822223128-186a048e2582 + github.com/PretendoNetwork/nex-protocols-go v0.0.0-20210822223420-363567a5d661 +) + +require github.com/superwhiskers/crunch/v3 v3.5.5 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..1a6a533 --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/PretendoNetwork/nex-go v0.0.0-20210822223128-186a048e2582 h1:HK9BE3SogLo4TOpWZxStvs/iHb9bp1Ju8/02VUnuct8= +github.com/PretendoNetwork/nex-go v0.0.0-20210822223128-186a048e2582/go.mod h1:T7NSb8t+ALS6dWJfuxGXowP7p5rUumZkBeUkQiS1ThQ= +github.com/PretendoNetwork/nex-protocols-go v0.0.0-20210822223420-363567a5d661 h1:4j0epTPML2WV/p1+Mvc5r75gagfadLKa3y+IfL/P6BA= +github.com/PretendoNetwork/nex-protocols-go v0.0.0-20210822223420-363567a5d661/go.mod h1:WBF5I1p3VDCR1/FMo1DT2Zr0AM8SwNxd85pBGwSr6YI= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/superwhiskers/crunch/v3 v3.5.5 h1:0kYwFtxw/XPVemkg7kBTRTaG4Ztgn3zTKR7L0/NJfyY= +github.com/superwhiskers/crunch/v3 v3.5.5/go.mod h1:hvNpQ5PIDqPgR9Idks7YrPP4tzRFFS+CcK+1pUAXG2k=