forked from nikhilkumarsingh/python-github-actions-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthfile
More file actions
47 lines (34 loc) · 1.03 KB
/
Copy pathEarthfile
File metadata and controls
47 lines (34 loc) · 1.03 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
VERSION 0.7
FROM python:3.9-slim
deps:
# Copy dependency files
COPY requirements.txt ./
# Install dependencies
RUN pip install -r requirements.txt
# Save the installed dependencies
SAVE ARTIFACT /usr/local/lib/python3.9/site-packages site-packages
test:
FROM +deps
# Copy source code and tests
COPY . .
# Copy saved dependencies
#COPY +deps/site-packages /usr/local/lib/python3.11/site-packages
# Run pytest
#RUN export PYTHONPATH=src
#RUN pip install pytest
RUN pytest
build:
FROM +deps
# Copy the application code
COPY . .
# Copy saved dependencies
COPY +deps/site-packages /usr/local/lib/python3.11/site-packages
# Create a clean installation for production
RUN pip install --no-deps .
# Set the entry point
ENTRYPOINT ["python", "-m", "your_package_name"]
# Save the final image
SAVE IMAGE your-project:latest
all:
BUILD +test
BUILD +build