Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dockerfile, go.mod and go.sum to allow deployment via docker and automatic dependency downloads #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=