diff --git a/.dockerignore b/.dockerignore index ef464e25f..d1e1d2a71 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,11 @@ docs images +# Front +skyvern-frontend/.env* +skyvern-frontend/dist +skyvern-frontend/node_modules + .dockerignore .gitignore Dockerfile \ No newline at end of file diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index f8bbb83a3..5440eb679 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -6,8 +6,9 @@ on: env: AWS_REGION: us-east-1 - ECR_REPOSITORY: skyvern - REGISTRY_ALIAS: t6d4b5t4 # skyvern + ECR_BACKEND_REPOSITORY: skyvern + ECR_UI_REPOSITORY: skyvern-ui + REGISTRY_ALIAS: skyvern # t6d4b5t4 jobs: run-ci: @@ -36,7 +37,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Build, tag, and push image to Amazon Public ECR + - name: Build, tag, and push backend image to Amazon Public ECR id: build-image uses: docker/build-push-action@v2 env: @@ -48,6 +49,23 @@ jobs: linux/arm64 push: true tags: | - ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }} - ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:${{ github.event.release.tag_name }} - ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:latest + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }} + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }} + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest + + - name: Build, tag, and push ui image to Amazon Public ECR + id: build-ui-image + uses: docker/build-push-action@v2 + env: + ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} + with: + context: . + file: Dockerfile.ui + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.sha }} + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.event.release.tag_name }} + ${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:latest diff --git a/Dockerfile.ui b/Dockerfile.ui new file mode 100644 index 000000000..9f887a3f3 --- /dev/null +++ b/Dockerfile.ui @@ -0,0 +1,12 @@ +FROM node:20.12-slim + +WORKDIR /app +COPY ./skyvern-frontend /app +COPY ./entrypoint-skyvernui.sh /app/entrypoint-skyvernui.sh +RUN npm install + +ENV VITE_API_BASE_URL=http://localhost:8000/api/v1 +ENV VITE_ARTIFACT_API_BASE_URL=http://localhost:9090 + +CMD [ "/bin/bash", "/app/entrypoint-skyvernui.sh" ] + diff --git a/docker-compose.yml b/docker-compose.yml index a2e8c8e34..25e85dd48 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ version: '3.8' services: postgres: image: postgres:14-alpine + restart: always # comment out if you want to externally connect DB # ports: # - 5432:5432 @@ -20,11 +21,11 @@ services: retries: 5 skyvern: - image: public.ecr.aws/t6d4b5t4/skyvern:latest + image: public.ecr.aws/skyvern/skyvern:latest restart: on-failure # comment out if you want to externally call skyvern API - # ports: - # - 8000:8000 + ports: + - 8000:8000 volumes: - ./artifacts:/data/artifacts - ./videos:/data/videos @@ -40,7 +41,7 @@ services: # - LLM_KEY=ANTHROPIC_CLAUDE3_OPUS # - ANTHROPIC_API_KEY= # - ENABLE_AZURE=true - # - LLM_KEY=AZURE_OPENAI_GPT4V + # - LLM_KEY=AZURE_OPENAI # - AZURE_DEPLOYMENT= # - AZURE_API_KEY= # - AZURE_API_BASE= @@ -53,9 +54,27 @@ services: interval: 5s timeout: 5s retries: 5 + + skyvern-ui: + image: public.ecr.aws/skyvern/skyvern-ui:latest + restart: on-failure + ports: + - 8080:8080 + - 9090:9090 + volumes: + - ./artifacts:/data/artifacts + - ./videos:/data/videos + - ./har:/data/har + - ./.streamlit:/app/.streamlit + # environment: + # - VITE_API_BASE_URL= + # - VITE_SKYVERN_API_KEY= + depends_on: + skyvern: + condition: service_healthy streamlit: - image: public.ecr.aws/t6d4b5t4/skyvern:latest + image: public.ecr.aws/skyvern/skyvern:latest restart: on-failure ports: - 8501:8501 diff --git a/entrypoint-skyvernui.sh b/entrypoint-skyvernui.sh new file mode 100644 index 000000000..348ed9a1a --- /dev/null +++ b/entrypoint-skyvernui.sh @@ -0,0 +1,11 @@ + +#!/bin/bash + +set -e + +# setting api key +export VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml) + +npm run start + +