Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
Added Makefile for dockering
Browse files Browse the repository at this point in the history
  • Loading branch information
wneessen committed May 17, 2021
1 parent 426f813 commit cd12582
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## Dockerfile for the Sea of Thieves Bot
##
FROM archlinux:base
FROM archlinux
LABEL maintainer="[email protected]"
RUN pacman -Syu --noconfirm --noprogressbar
RUN pacman -S --noconfirm --noprogressbar sqlite
RUN /usr/bin/groupadd -r sotbot && /usr/bin/useradd -r -g sotbot -c "Sea of Thieves Bot" -m -s /bin/bash -d /opt/sotbot sotbot
COPY ["LICENSE", "README.md", "/opt/sotbot/"]
COPY ["bin", "/opt/sotbot/bin"]
Expand Down
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
MODNAME := github.com/wneessen/sotbot
SPACE := $(null) $(null)
CURVER := 1.0.0b
BUILDDIR := ./bin
TZ := UTC

ifeq ($(OS), Windows_NT)
OUTFILE := $(BUILDDIR)/sotbot.exe
else
OUTFILE := $(BUILDDIR)/sotbot
endif

TARGETS := build-prod
DOCKERTARGETS := build-prod dockerize

all: $(TARGETS)

test:
go test $(MODNAME)

build-prod:
/usr/bin/env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o $(OUTFILE) -ldflags="-s -w" $(MODNAME)/cmd/sotbot

run-prod:
@go run -ldflags="-s -w" $(MODNAME)/cmd/sotbot

dockerize:
@sudo docker build -t sotbot:v$(CURVER) .

0 comments on commit cd12582

Please sign in to comment.