Docker
This contains the document about what tech stack Solverhoold team uses.
We prefer to move the major services into separate container or global installation instead of adding all the services as one docker.
So here is the example i prefer
FROM golang:1.24.4-alpine3.22
RUN apk update && apk add --no-cache git ca-certificates curl socat
RUN curl -L -o pkl https://github.com/apple/pkl/releases/download/0.25.2/pkl-alpine-linux-amd64 && chmod +x pkl && mv pkl /usr/local/bin/
RUN curl -L -o pkl-gen-go https://github.com/apple/pkl-go/releases/download/v0.10.0/pkl-gen-go-linux-aarch64.bin && chmod +x pkl-gen-go && mv pkl-gen-go /usr/local/bin/
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
# Determine architecture and install pkl accordingly
# RUN ARCH=$(uname -m) && \
# echo "Detected architecture: $ARCH" && \
# if [ "$ARCH" = "aarch64" ]; then \
# curl -L -o /bin/pkl 'https://github.com/apple/pkl/releases/download/0.28.2/pkl-linux-aarch64' && \
# curl -L -o /bin/pkl-gen-go 'https://github.com/apple/pkl-go/releases/download/v0.10.0/pkl-gen-go-linux-aarch64.bin'; \
# elif [ "$ARCH" = "x86_64" ]; then \
# curl -L -o /bin/pkl 'https://github.com/apple/pkl/releases/download/0.28.2/pkl-linux-amd64' && \
# curl -L -o /bin/pkl-gen-go 'https://github.com/apple/pkl-go/releases/download/v0.10.0/pkl-gen-go-linux-amd64.bin'; \
# else \
# echo "Unsupported architecture: $ARCH" && exit 1; \
# fi && \
# chmod +x /bin/pkl && \
# chmod +x /bin/pkl-gen-go && \
# ls -la /bin/pkl* && \
# /bin/pkl --version
ENV CGO_ENABLED=0 GO111MODULE=on GOOS=linux
# ENV GOFLAGS=-mod=vendor
WORKDIR /app
ARG PORT
# add it as setting option while create container out of image
EXPOSE $PORT
COPY go.work ./
COPY go.work.sum ./
COPY configmgr/go.mod ./configmgr/
COPY gql/go.mod ./gql/
COPY gqlsa/go.mod ./gqlsa/
COPY gqltool/go.mod ./gqltool/
COPY lace/go.mod ./lace/
COPY saas/go.mod ./saas/
COPY saasbyteapi/go.mod ./saasbyteapi/
RUN go work vendor
RUN go install github.com/air-verse/air@latest
# Create .bashrc with port forwarding commands
RUN echo 'socat TCP-LISTEN:2303,fork TCP:host.docker.internal:2303 &' >> /root/.bashrc
RUN echo 'socat TCP-LISTEN:2311,fork TCP:host.docker.internal:2311 &' >> /root/.bashrc
RUN echo 'socat TCP-LISTEN:5432,fork TCP:host.docker.internal:5432 &' >> /root/.bashrc
RUN echo 'socat TCP-LISTEN:6379,fork TCP:host.docker.internal:6379 &' >> /root/.bashrc
# RUN source /etc/profile
# Source profile to enable port forwarding
# CMD ["sh", "-c", "source /etc/profile && exec $0 $@"]