diff --git a/.github/workflows/beta-image.yml b/.github/workflows/beta-image.yml index a87f3357..3e1ed5bc 100644 --- a/.github/workflows/beta-image.yml +++ b/.github/workflows/beta-image.yml @@ -81,6 +81,7 @@ jobs: file: "./docker/PythonDockerfile" platforms: | linux/amd64 + linux/arm64 # Note: tags have to be all lower-case tags: ${{ steps.meta_python.outputs.tags }} labels: ${{ steps.meta_python.outputs.labels }} diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 24f5d96d..370fa657 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -98,6 +98,7 @@ jobs: file: "./docker/PythonDockerfile" platforms: | linux/amd64 + linux/arm64 # Note: tags have to be all lower-case tags: ${{ steps.meta_python.outputs.tags }} labels: ${{ steps.meta_python.outputs.labels }} diff --git a/docker-compose-dev-macos.yml b/docker-compose-dev-macos.yml deleted file mode 100644 index c35aeb5f..00000000 --- a/docker-compose-dev-macos.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: linguacafedev - -networks: - linguacafedev: - driver: bridge - -services: - webserver: - container_name: linguacafe-webserver-dev - restart: unless-stopped - build: - context: . - dockerfile: ./docker/PhpDockerfileDev - depends_on: - mysql: - condition: service_healthy - volumes: - - ./:/var/www/html - - ./docker/vhost.conf:/etc/apache2/sites-available/000-default.conf - - ./docker/supervisor-horizon.conf:/etc/supervisor/conf.d/horizon.conf - - ./docker/supervisor-websockets.conf:/etc/supervisor/conf.d/websockets.conf - environment: - PYTHON_CONTAINER_NAME: linguacafe-python-service-dev - DB_DATABASE: linguacafe-dev - DB_USERNAME: linguacafe-dev - DB_PASSWORD: linguacafe-dev - DB_HOST: linguacafe-database-dev - DB_PORT: 3306 - REDIS_HOST: linguacafe-redis-dev - BACKUP_INTERVAL: "0,15,30,45 * * * *" - MAX_SAVED_BACKUPS: 8 - ports: - - "6001:6001" - - "3000:3000" - - "81:80" - networks: - - linguacafedev - extra_hosts: - - "host.docker.internal:host-gateway" - mysql: - image: mysql:8.0 - container_name: linguacafe-database-dev - restart: unless-stopped - tty: true - healthcheck: - test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$MYSQL_ROOT_PASSWORD'] - interval: 5s - timeout: 5s - retries: 10 - ports: - - "3308:3306" - volumes: - - ./docker/mysql:/var/lib/mysql - environment: - MYSQL_DATABASE: linguacafe-dev - MYSQL_USER: linguacafe-dev - MYSQL_PASSWORD: linguacafe-dev - MYSQL_ROOT_PASSWORD: linguacafe-dev - SERVICE_NAME: linguacafe-dev - networks: - - linguacafedev - redis: - image: redis:7.2-alpine - container_name: linguacafe-redis-dev - restart: unless-stopped - volumes: - - ./cache:/data - ports: - - "6379:6379" - environment: - REDIS_PASSWORD: linguacafe-dev - REDIS_PORT: 6379 - REDIS_DATABASES: 16 - networks: - - linguacafedev - python: - container_name: linguacafe-python-service-dev - command: "python3 /app/tokenizer.py" - restart: unless-stopped - tty: true - ports: - - "8678:8678" - build: - dockerfile: ./docker/PythonDockerfileDev - volumes: - - ./tools:/app - - ./storage/app:/var/www/html/storage/app - networks: - - linguacafedev - environment: - PYTHONPATH: "/var/www/html/storage/app/model" - platform: linux/amd64 \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 43dc1a41..981a0646 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -43,7 +43,7 @@ services: restart: unless-stopped tty: true healthcheck: - test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$MYSQL_ROOT_PASSWORD'] + test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-plinguacafe-dev'] interval: 5s timeout: 5s retries: 10 @@ -63,7 +63,7 @@ services: image: redis:7.2-alpine container_name: linguacafe-redis-dev restart: unless-stopped - volumes: + volumes: - ./cache:/data ports: - "6379:6379" @@ -82,6 +82,10 @@ services: - "8678:8678" build: dockerfile: ./docker/PythonDockerfileDev +# for testing arm build +# platforms: +# - linux/arm64 +# - linux/amd64 volumes: - ./tools:/app - ./storage/app:/var/www/html/storage/app diff --git a/docker-compose.yml b/docker-compose.yml index d43d80b9..26c3e3b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: restart: unless-stopped tty: true healthcheck: - test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$MYSQL_ROOT_PASSWORD'] + test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p${DB_ROOT_PASSWORD:-linguacafe}'] interval: 10s timeout: 5s retries: 10 @@ -56,7 +56,7 @@ services: image: redis:7.2-alpine container_name: linguacafe-redis restart: unless-stopped - volumes: + volumes: - ./cache:/data ports: - "6379:6379" @@ -78,4 +78,4 @@ services: - ./storage:/var/www/html/storage networks: - linguacafe - platform: ${PLATFORM:-} \ No newline at end of file + platform: ${PLATFORM:-} diff --git a/docker/PythonDockerfile b/docker/PythonDockerfile index ec29c33b..c72e0319 100644 --- a/docker/PythonDockerfile +++ b/docker/PythonDockerfile @@ -2,7 +2,12 @@ FROM ubuntu:22.04 WORKDIR /app RUN apt-get update -y \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + gfortran \ + liblapack-dev \ + libopenblas-dev \ python3 \ python3-dev \ pip \ @@ -14,7 +19,10 @@ RUN addgroup --gid 1000 laravel \ && adduser --ingroup laravel --disabled-password --gecos "" --shell /bin/sh laravel USER laravel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENV BLIS_ARCH="generic" RUN pip install -U --no-cache-dir \ + pip \ setuptools \ wheel \ lxml \ diff --git a/docker/PythonDockerfileDev b/docker/PythonDockerfileDev index 57923070..e7e02448 100644 --- a/docker/PythonDockerfileDev +++ b/docker/PythonDockerfileDev @@ -2,7 +2,12 @@ FROM ubuntu:22.04 WORKDIR /app RUN apt-get update -y \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + gfortran \ + liblapack-dev \ + libopenblas-dev \ python3 \ python3-dev \ pip \ @@ -14,7 +19,10 @@ RUN addgroup --gid 1000 laravel \ && adduser --ingroup laravel --disabled-password --gecos "" --shell /bin/sh laravel USER laravel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENV BLIS_ARCH="generic" RUN pip install -U --no-cache-dir \ + pip \ setuptools \ wheel \ lxml \