Part 3

Development with Docker

dev/Dockerfile

FROM ubuntu:22.04
ENV PROMPT_COMMAND="history -a"

RUN apt-get update && apt-get install -y curl

RUN mkdir /ghjk && cd /ghjk \
  && [ "$(uname -m)" = "aarch64" ] && arch="arm64" || arch="amd64" \
  && curl -Lf "https://github.com/cespare/reflex/releases/download/v0.3.1/reflex_linux_${arch}.tar.gz" -o reflex.tar.gz \
  && tar -xvof reflex.tar.gz \
  && cp "reflex_linux_${arch}/reflex" /usr/local/bin \
  && rm -rf /ghjk

WORKDIR /app
COPY app .

ENTRYPOINT [ "/app/entrypoint.sh" ]

dev/entrypoint.sh

#!/usr/bin/env bash
set -eEuo pipefail

reflex -s -v /app/app.sh

dev/app.sh

#!/usr/bin/env bash
set -eEuo pipefail

while true
do
  date
  sleep 1
done

dev/docker-compose.yml

version: '3'

services:
  app:
    build: .
    volumes:
      - ./app:/app
      - ./root:/root
docker compose up --build --force-recreate
You have reached the end of this section! Continue to the next section: