lemnos / tt

A terminal based typing test.
MIT License
737 stars 49 forks source link

Functional: Docker install #41

Open joel72265 opened 1 year ago

joel72265 commented 1 year ago

Thank you for the application.

Please can you try to make a docker install of the program, that would be very good

nnzv commented 1 year ago

Here's a simple example for you:

Dockerfile

# This stage sets up tools to build the project, clones it, and creates an executable named `tt`.
FROM golang:alpine AS build

ENV CGO_ENABLED=0 

WORKDIR /app

RUN apk add --no-cache git \
    && git clone --depth=1 https://github.com/lemnos/tt . \
    && go build -o bin/tt src/*.go

# Copies the `tt` executable and sets it as the command to run.
FROM alpine

COPY --from=build  /app/bin/tt /bin/tt

ENTRYPOINT ["tt"]

How

# Build the Docker Image
docker build . -t dev:tt
# Run the Docker Container
docker run -it dev:tt
# To use `tt` with extra options
docker run -it dev:tt -h
joel72265 commented 1 year ago

thank you for the steps :)

I will try to understand these step and follow

joel72265 commented 1 year ago

hi, I am able to to run the following commands

root@tt [ ~ ]# curl -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt-osx -o /usr/local/bin/tt && sudo chmod +x /usr/local/bin/tt root@tt [ ~ ]# curl -o /usr/share/man/man1/tt.1.gz -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt.1.gz root@tt [ ~ ]# tt -quotes en

I am able to use the application on the local system using SSH but I would like to run it as a container (and port) so that I can use it from a Web Browser. If you have any steps that would be very useful.

System: Photon OS

nnzv commented 1 year ago

This Go project is a TUI app. It can't turn into a web app easily. Seeing a web version of 'tt' would be intriguing. However, I think it should be a fork, not altering the original functionality. This goes beyond the project's scope.

joel72265 commented 1 year ago

yes, even a fork version. A web based application keeping the size minimal would be great :)