Skip to content

Commit

Permalink
Merge pull request #23 from fc92/groom
Browse files Browse the repository at this point in the history
single Dockefile for poker and groom
  • Loading branch information
fc92 authored Mar 9, 2023
2 parents 8824dfa + 0128984 commit cc2b6c4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
11 changes: 8 additions & 3 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ RUN ls cmd
RUN go vet -v ./...
RUN go test -v ./...

WORKDIR /go/src/app/cmd
RUN CGO_ENABLED=0 go build -o /go/bin/poker
WORKDIR /go/src/app
RUN CGO_ENABLED=0 go build -o /go/bin/poker cmd/poker.go
RUN CGO_ENABLED=0 go build -o /go/bin/groom cmd/groom/groom.go

# for tty2web an image with a shell is required
FROM alpine:3.17.2
Expand All @@ -30,11 +31,15 @@ ADD https://github.com/kost/tty2web/releases/download/v2.7.1/tty2web_linux_amd64

COPY build/package/poker.sh /
COPY build/package/clients.sh /
COPY build/package/groom.sh /
COPY build/package/groom-clients.sh /
# prepare a script /clients.sh to launch the server as well as tty2web to welcome incoming clients
# make the script and binary executable
RUN chmod +x /tty2web \
&& chmod +x /clients.sh \
&& chmod +x poker.sh
&& chmod +x /groom.sh \
&& chmod +x /groom-clients.sh \
&& chmod +x /poker.sh

RUN mkdir /log && chmod 777 /log
RUN chown 1000:1000 /log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ LABEL org.opencontainers.image.licenses=MIT

WORKDIR /go/src
COPY . /go/src
COPY build/package/groom/groom.sh /
COPY build/package/groom/clients.sh /
COPY build/package/groom.sh /
COPY build/package/groom-clients.sh /
RUN CGO_ENABLED=0 go install github.com/go-delve/delve/cmd/dlv@latest
# download tty2web binary
ADD https://github.com/kost/tty2web/releases/download/v2.7.1/tty2web_linux_amd64 /tty2web
Expand All @@ -23,7 +23,7 @@ RUN cp /go/bin/dlv / && \
chmod +x /dlv && \
chmod +x /groom && \
chmod +x /groom.sh && \
chmod +x /clients.sh && \
chmod +x /groom-clients.sh && \
chmod +x /tty2web

RUN mkdir /log && chmod 777 /log
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion deployments/poker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ spec:
name: {{ $room | lower }}-port
containerPort: {{ $.Values.tty2webPort | add $index }}
securityContext:
# capabilities:
# drop:
# - all
runAsUser: 1000
runAsGroup: 1000
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
automountServiceAccountToker: false
# automountServiceAccountToker: false
resources:
requests:
cpu: 50m
Expand Down
2 changes: 1 addition & 1 deletion deployments/poker/templates/groom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
imagePullPolicy: {{ .Values.imagegroom.pullPolicy }}
name: groom
tty: true # this is required for tty2web to work
command: [ "/clients.sh" ]
command: [ "/groom-clients.sh" ]
args: [ "{{ .Values.groomPort }}" ]
readinessProbe:
httpGet:
Expand Down
5 changes: 5 additions & 0 deletions deployments/poker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ image:
repository: ghcr.io/fc92/poker
tag: main
pullPolicy: IfNotPresent # default PullPolicy
imagegroom:
repository: ghcr.io/fc92/poker
tag: main
pullPolicy: IfNotPresent # default PullPolicy
externalDomain: poker.local # UPDATE required for target domain
groomPort: 38888
3 changes: 2 additions & 1 deletion internal/groom/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"errors"
"os"

"github.com/fc92/poker/internal/common"
"github.com/rs/zerolog/log"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/release"

"github.com/fc92/poker/internal/common"
)

const (
Expand Down

0 comments on commit cc2b6c4

Please sign in to comment.