ceck
Browse files- .github/workflows/fly-deploy.yml +18 -0
- Dockerfile +21 -0
- fly.toml +22 -0
.github/workflows/fly-deploy.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
|
| 2 |
+
|
| 3 |
+
name: Fly Deploy
|
| 4 |
+
on:
|
| 5 |
+
push:
|
| 6 |
+
branches:
|
| 7 |
+
- main
|
| 8 |
+
jobs:
|
| 9 |
+
deploy:
|
| 10 |
+
name: Deploy app
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
concurrency: deploy-group # optional: ensure only one action runs at a time
|
| 13 |
+
steps:
|
| 14 |
+
- uses: actions/checkout@v4
|
| 15 |
+
- uses: superfly/flyctl-actions/setup-flyctl@master
|
| 16 |
+
- run: flyctl deploy --remote-only
|
| 17 |
+
env:
|
| 18 |
+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image from the Docker Hub
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
+
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
+
APP_HOME=/app
|
| 7 |
+
|
| 8 |
+
# Set the working directory
|
| 9 |
+
WORKDIR $APP_HOME
|
| 10 |
+
|
| 11 |
+
# Copy the current directory contents into the container at /app
|
| 12 |
+
COPY . .
|
| 13 |
+
|
| 14 |
+
# Install any needed packages specified in requirements.txt
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
+
|
| 17 |
+
# Expose port 8080 to the outside world
|
| 18 |
+
EXPOSE 8080
|
| 19 |
+
|
| 20 |
+
# Run the application
|
| 21 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|
fly.toml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# fly.toml app configuration file generated for named-entity-recognition on 2024-11-04T14:08:51+04:00
|
| 2 |
+
#
|
| 3 |
+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
| 4 |
+
#
|
| 5 |
+
|
| 6 |
+
app = 'named-entity-recognition'
|
| 7 |
+
primary_region = 'ams'
|
| 8 |
+
|
| 9 |
+
[build]
|
| 10 |
+
|
| 11 |
+
[http_service]
|
| 12 |
+
internal_port = 8080
|
| 13 |
+
force_https = true
|
| 14 |
+
auto_stop_machines = 'stop'
|
| 15 |
+
auto_start_machines = true
|
| 16 |
+
min_machines_running = 0
|
| 17 |
+
processes = ['app']
|
| 18 |
+
|
| 19 |
+
[[vm]]
|
| 20 |
+
memory = '1gb'
|
| 21 |
+
cpu_kind = 'shared'
|
| 22 |
+
cpus = 1
|