-
Notifications
You must be signed in to change notification settings - Fork 2
/
Earthfile
35 lines (29 loc) · 824 Bytes
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
VERSION 0.6
FROM --platform=linux/arm64 python:3.9
ARG IMAGE=punparin/solomon-bot
ARG TAG=latest
WORKDIR /app
build:
RUN pip install wheel
COPY requirements.txt ./
RUN pip wheel -r requirements.txt --wheel-dir=wheels
COPY src src
SAVE ARTIFACT src /src
SAVE ARTIFACT wheels /wheels
release:
COPY +build/src src
COPY +build/wheels wheels
COPY requirements.txt ./
RUN pip install --no-index --find-links=wheels -r requirements.txt
ENTRYPOINT ["python3", "-u", "./src/main.py"]
SAVE IMAGE --push $IMAGE:$TAG
compose-up:
LOCALLY
WITH DOCKER --load=+release \
--build-arg IMAGE=$IMAGE \
--build-arg TAG=local
RUN docker-compose -f docker-compose.yaml up -d
END
compose-down:
LOCALLY
RUN docker-compose -f docker-compose.yaml down