File tree Expand file tree Collapse file tree 4 files changed +45
-17
lines changed Expand file tree Collapse file tree 4 files changed +45
-17
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ USER root
6
6
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
7
7
USER $USER
8
8
9
+ COPY . .
9
10
# install devcontainer requirements
10
11
RUN pip install -e .[dev,test]
11
12
12
13
# docs requirements are in a separate file for the GitHub Action
13
- COPY docs/requirements.txt docs/requirements.txt
14
14
RUN pip install -r docs/requirements.txt
Original file line number Diff line number Diff line change 1
- .github /
2
- .vscode /
3
1
** /__pycache__ /
4
- .flake8
5
- . * ignore
2
+ node_modules /
3
+ static /
4
+ .coverage
6
5
* .db
7
6
* .egg-info
7
+ * .log
8
+ * .mo
9
+ .DS_Store
10
+ .env
Original file line number Diff line number Diff line change 1
- FROM ghcr.io/cal-itp/docker-python-web:main
1
+ # multi-stage build
2
+ #
3
+ # stage 1: builds the benefits package from source
4
+ # using the git metadata for version info
5
+ FROM ghcr.io/cal-itp/docker-python-web:main AS build_wheel
6
+
7
+ WORKDIR /build
2
8
3
9
# upgrade pip
4
- RUN python -m pip install --upgrade pip
10
+ RUN python -m pip install --upgrade pip && \
11
+ pip install build
12
+
13
+ # copy source files
14
+ COPY . .
15
+ RUN git config --global --add safe.directory /build
16
+
17
+ # build package
18
+ RUN python -m build
19
+
20
+ # multi-stage build
21
+ #
22
+ # stage 2: installs the benefits package in a fresh base container
23
+ # using the pre-built package, and copying only needed source
24
+ FROM ghcr.io/cal-itp/docker-python-web:main AS appcontainer
5
25
6
26
# overwrite default nginx.conf
7
27
COPY appcontainer/nginx.conf /etc/nginx/nginx.conf
8
28
COPY appcontainer/proxy.conf /calitp/run/proxy.conf
9
29
10
- # copy files needed for version metadata
11
- COPY .git .git
12
-
13
- # copy source files
30
+ # copy runtime files
31
+ COPY --from=build_wheel /build/dist /build/dist
14
32
COPY manage.py manage.py
15
33
COPY bin bin
16
34
COPY benefits benefits
17
- COPY pyproject.toml pyproject.toml
18
35
19
- RUN pip install -e .
36
+ # install source as a package
37
+ RUN pip install $(find /build/dist -name benefits*.whl)
20
38
21
- # ensure $USER can compile messages in the locale directories
22
39
USER root
40
+ COPY LICENSE LICENSE
41
+ # ensure $USER can compile messages in the locale directories
23
42
RUN chmod -R 777 benefits/locale
24
43
USER $USER
25
44
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ readme = "README.md"
6
6
license = { file = " LICENSE" }
7
7
classifiers = [" Programming Language :: Python :: 3 :: Only" ]
8
8
requires-python = " >=3.9"
9
+ maintainers = [
10
+ {
name =
" Compiler LLC" ,
email =
" [email protected] " }
11
+ ]
9
12
dependencies = [
10
13
" Authlib==1.3.2" ,
11
14
" azure-keyvault-secrets==4.8.0" ,
@@ -39,12 +42,14 @@ test = [
39
42
]
40
43
41
44
[project .urls ]
45
+ Changelog = " https://github.com/cal-itp/benefits/releases"
42
46
Code = " https://github.com/cal-itp/benefits"
43
47
Documentation = " https://docs.calitp.org/benefits"
48
+ Homepage = " https://www.calitp.org/#initiatives-benefits"
44
49
Issues = " https://github.com/cal-itp/benefits/issues"
45
50
46
51
[build-system ]
47
- requires = [" setuptools>=65" , " wheel " , " setuptools-scm>=8" ]
52
+ requires = [" setuptools>=65" , " setuptools-scm>=8" ]
48
53
build-backend = " setuptools.build_meta"
49
54
50
55
[tool .black ]
@@ -79,8 +84,9 @@ markers = [
79
84
" request_path: use with session_request to initialize with the given path" ,
80
85
]
81
86
82
- [tool .setuptools ]
83
- packages = [" benefits" ]
87
+ [tool .setuptools .packages .find ]
88
+ include = [" benefits*" ]
89
+ namespaces = false
84
90
85
91
[tool .setuptools_scm ]
86
92
# intentionally left blank, but we need the section header to activate the tool
You can’t perform that action at this time.
0 commit comments