From 5293cba9c522ac36698879dc46bda0e4ebf07ca9 Mon Sep 17 00:00:00 2001 From: Yehor Smoliakov Date: Tue, 20 Aug 2024 15:15:05 +0300 Subject: [PATCH] Next update: v1.2 #107 --- README.md | 4 ++-- apps/go-hello/Dockerfile | 28 ++++++++++++++-------------- apps/go-hello/README.md | 9 +++++++-- apps/go-hello/go.mod | 2 +- apps/go-hello/taskfile.yml | 14 ++++++++++++++ apps/python-hello/Dockerfile | 4 ++-- apps/python-hello/README.md | 9 +++++++-- apps/python-hello/requirements.txt | 1 + apps/python-hello/taskfile.yml | 14 ++++++++++++++ 9 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 apps/go-hello/taskfile.yml create mode 100644 apps/python-hello/requirements.txt create mode 100644 apps/python-hello/taskfile.yml diff --git a/README.md b/README.md index 82512c1..c399f71 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ > It must: > - be on the latest version of Laravel > - be lightweight to run with Docker -> - use modern technologies such as **PHP 8.3**, **Go 1.22**, **Python 3.12**, etc. +> - use modern technologies such as **PHP 8.3**, **Go 1.23**, **Python 3.12**, etc. ### Requirements -- [Moby](https://github.com/moby/moby) 26.x +- [Moby](https://github.com/moby/moby) 27.x - [Task](https://taskfile.dev) 3.x - [Bun](https://bun.sh) 1.x diff --git a/apps/go-hello/Dockerfile b/apps/go-hello/Dockerfile index 8790617..06d12da 100644 --- a/apps/go-hello/Dockerfile +++ b/apps/go-hello/Dockerfile @@ -1,21 +1,21 @@ -FROM golang:1.22.5-alpine3.20 AS build +FROM golang:1.23.0-alpine3.20 AS build WORKDIR /app COPY go.mod go.sum ./ -ENV CGO_ENABLED=1 GOOS=linux - -RUN apk update \ - && apk add --no-cache ca-certificates \ - git \ - build-base \ - gcc \ - g++ \ - pkgconfig \ - linux-headers \ - zeromq \ - zeromq-dev \ +ENV CGO_ENABLED=1 +ENV GOOS=linux + +RUN apk update && apk add --no-cache \ + ca-certificates=20240705-r0 \ + git=2.45.2-r0 \ + build-base=0.5-r3 \ + gcc=13.2.1_git20240309-r0 \ + g++=13.2.1_git20240309-r0 \ + linux-headers=6.6-r0 \ + zeromq=4.3.5-r2 \ + zeromq-dev=4.3.5-r2 \ && rm -rf /var/cache/apk/* RUN go mod download && go mod verify @@ -29,7 +29,7 @@ FROM alpine:3.20 WORKDIR /app -RUN apk add --no-cache zeromq +RUN apk add --no-cache zeromq=4.3.5-r2 COPY --from=build /app/server . diff --git a/apps/go-hello/README.md b/apps/go-hello/README.md index 404ed7a..57020d0 100644 --- a/apps/go-hello/README.md +++ b/apps/go-hello/README.md @@ -1,7 +1,12 @@ # Go sample application -## Build the image +### Usage ```bash -docker build --tag go_hello:1.0 . +# Build image +task build + +# Linting +task lint-dockerfile +task lint-yaml ``` diff --git a/apps/go-hello/go.mod b/apps/go-hello/go.mod index 5aa4e9c..aebed58 100644 --- a/apps/go-hello/go.mod +++ b/apps/go-hello/go.mod @@ -1,5 +1,5 @@ module github.com/egorsmkv/laravel-boilerplate/apps/go-hello -go 1.22.5 +go 1.23.0 require github.com/pebbe/zmq4 v1.2.11 diff --git a/apps/go-hello/taskfile.yml b/apps/go-hello/taskfile.yml new file mode 100644 index 0000000..010ce36 --- /dev/null +++ b/apps/go-hello/taskfile.yml @@ -0,0 +1,14 @@ +version: '3' + +tasks: + build: + cmds: + - docker build --tag go_hello:1.0 . + + lint-dockerfile: + cmds: + - docker run --rm -i hadolint/hadolint < Dockerfile + + lint-yaml: + cmds: + - yamllint -d relaxed taskfile.yml diff --git a/apps/python-hello/Dockerfile b/apps/python-hello/Dockerfile index b059e72..dd1dbe2 100644 --- a/apps/python-hello/Dockerfile +++ b/apps/python-hello/Dockerfile @@ -1,11 +1,11 @@ FROM python:3.12-slim -RUN pip install --no-cache-dir pyzmq - WORKDIR /app COPY . . +RUN pip install --no-cache-dir -r requirements.txt + EXPOSE 5555 CMD ["python", "/app/server.py"] diff --git a/apps/python-hello/README.md b/apps/python-hello/README.md index 19259ae..69670dc 100644 --- a/apps/python-hello/README.md +++ b/apps/python-hello/README.md @@ -1,7 +1,12 @@ # Python sample application -## Build the image +### Usage ```bash -docker build --tag python_hello:1.0 . +# Build image +task build + +# Linting +task lint-dockerfile +task lint-yaml ``` diff --git a/apps/python-hello/requirements.txt b/apps/python-hello/requirements.txt new file mode 100644 index 0000000..38e1ec8 --- /dev/null +++ b/apps/python-hello/requirements.txt @@ -0,0 +1 @@ +pyzmq==26.1.1 diff --git a/apps/python-hello/taskfile.yml b/apps/python-hello/taskfile.yml new file mode 100644 index 0000000..ff1e743 --- /dev/null +++ b/apps/python-hello/taskfile.yml @@ -0,0 +1,14 @@ +version: '3' + +tasks: + build: + cmds: + - docker build --tag python_hello:1.0 . + + lint-dockerfile: + cmds: + - docker run --rm -i hadolint/hadolint < Dockerfile + + lint-yaml: + cmds: + - yamllint -d relaxed taskfile.yml