Hello everyone!
I’m trying to deploy a multi-container app using fly deploy
for the first time and stuck immediately.
I’m using the Container Demo as an example for translating the Telegram Bot API + nginx app to a Fly multi-container app. So far I’m encountering this error:
Error: failed to fetch an image or build from source: app does not have a Dockerfile or buildpacks configured. See https ://fly.io/docs/reference/configuration/#the-build-section
Here are my project files:
fly.toml:
app = 'my-app'
primary_region = 'mad'
swap_size_mb = 1024
[[mounts]]
source = 'telegram_bot_api_data'
destination = '/var/lib/telegram-bot-api'
initial_size = '1gb'
[[services]]
protocol = 'tcp'
internal_port = 8081
auto_stop_machines = 'off'
auto_start_machines = true
[[services.ports]]
port = 8081
[[services.tcp_checks]]
interval = '10s'
timeout = '2s'
[[restart]]
policy = 'always'
processes = ['app']
[[vm]]
size = 'shared-cpu-1x'
memory = '256mb'
compose.yml:
version: "3.8"
services:
api:
image: aiogram/telegram-bot-api:latest
restart: always
environment:
TELEGRAM_API_ID: ${TELEGRAM_API_ID}
TELEGRAM_API_HASH: ${TELEGRAM_API_HASH}
TELEGRAM_LOCAL: ${TELEGRAM_LOCAL}
volumes:
- telegram-bot-api-data:/var/lib/telegram-bot-api
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8081"]
nginx:
image: nginx:1.27.3-alpine
restart: always
depends_on:
api:
condition: service_healthy
volumes:
- telegram-bot-api-data:/var/lib/telegram-bot-api
- ./nginx:/etc/nginx/conf.d/
ports:
- "80:80"
volumes:
telegram-bot-api-data:
The project’s directory tree:
project/
├─ nginx/
│ └─ default.conf
├─ compose.yml
└─ fly.toml
I’m using these commands:
fly launch --no-deploy --ha=false
fly ips allocate-v6 --private
fly secrets import < .env
fly deploy