From 5f858a7c1cd0b9467747c212e134a31743529a33 Mon Sep 17 00:00:00 2001 From: Michel Bats Date: Mon, 6 Nov 2023 22:50:43 +0100 Subject: [PATCH] v1.0.0-beta.3 --- Dockerfile | 16 ++++++++++++++++ docker-compose.build.yml | 15 +++++++++++++++ docker-compose.yml | 10 ++++++++++ readme.md | 13 +++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.build.yml create mode 100644 docker-compose.yml create mode 100644 readme.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..85cfb26 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# Arguments +ARG NODE_TAG=12.18.3 +ARG PYBRICKSCODE_TAG=v1.0.0-beta.3 + +# Build stage +FROM node:${NODE_TAG} AS build-stage +ARG PYBRICKSCODE_TAG +WORKDIR /app +RUN git clone https://github.com/pybricks/pybricks-code -b "${PYBRICKSCODE_TAG}" /app +RUN cd /app +RUN yarn install +RUN yarn build + +# Production stage +FROM nginx:stable-alpine-slim +COPY --from=build-stage /app/build /usr/share/nginx/html diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..c3c0b58 --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,15 @@ +services: + # Pybricks Code + pybrickscode: + container_name: ${PYBRICKSCODE_CONTAINER_NAME:-PybricksCode} + build: + context: . + dockerfile: Dockerfile + args: + NODE_TAG: ${NODE_TAG:-12.18.3} + PYBRICKSCODE_TAG: ${PYBRICKSCODE_TAG:-v1.0.0-beta.3} + restart: ${RESTART:-unless-stopped} + healthcheck: + test: curl -f http://localhost:80/ || exit 1 + ports: + - ${PYBRICKSCODE_PORT:-80}:80 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7b45fe7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + # Pybricks Code + pybrickscode: + container_name: ${PYBRICKSCODE_CONTAINER_NAME:-PybricksCode} + image: axchrono/pybrickscode:${PYBRICKSCODE_TAG:-v1.0.0-beta.3} + restart: ${RESTART:-unless-stopped} + healthcheck: + test: curl -f http://localhost:80/ || exit 1 + ports: + - ${PYBRICKSCODE_PORT:-80}:80 diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b296dab --- /dev/null +++ b/readme.md @@ -0,0 +1,13 @@ +# pybricks-code + +A Web App for programming LEGO® Powered Up smart hubs using Pybricks MicroPython running in a Docker container. + +## Run pybricks-code + +```sh +docker compose up -d +``` + +## Disclaimer + +LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project.