-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from cmason3/23.9.1
23.9.1
- Loading branch information
Showing
4 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
FROM docker.io/library/python:3.11-slim | ||
FROM docker.io/library/python:3.11-slim AS BUILD | ||
|
||
ARG BRANCH="main" | ||
|
||
ENV PATH ${PATH}:/opt/jinjafx/.local/bin | ||
|
||
RUN set -eux; \ | ||
|
||
apt-get update; \ | ||
apt-get install -y --no-install-recommends git; \ | ||
|
||
groupadd -g 99 -r jinjafx; \ | ||
useradd -m jinjafx -u 99 -g 99 -d /opt/jinjafx -k /dev/null; \ | ||
python3 -m venv /opt/jinjafx; \ | ||
/opt/jinjafx/bin/python3 -m pip install --upgrade git+https://github.com/cmason3/jinjafx_server.git@${BRANCH} lxml; \ | ||
/opt/jinjafx/bin/python3 -m pip uninstall -y pip | ||
|
||
# runuser -u jinjafx -- python3 -m pip --disable-pip-version-check --no-cache-dir install --user jinjafx-server | ||
runuser -u jinjafx -- python3 -m pip --disable-pip-version-check --no-cache-dir install --user git+https://github.com/cmason3/jinjafx_server.git@${BRANCH} lxml; \ | ||
|
||
apt-get purge -y --auto-remove git; \ | ||
rm -rf /var/lib/apt/lists/* | ||
FROM docker.io/library/python:3.11-slim | ||
|
||
USER jinjafx | ||
COPY --from=BUILD --chown=99:99 /opt/jinjafx /opt/jinjafx | ||
|
||
WORKDIR /opt/jinjafx | ||
USER 99:99 | ||
|
||
ENTRYPOINT [ "python3", "-u", ".local/bin/jinjafx_server", "-s", "-l", "0.0.0.0", "-p", "8080" ] | ||
ENTRYPOINT [ "/opt/jinjafx/bin/python3", "-u", "-m", "jinjafx_server", "-s", "-l", "0.0.0.0", "-p", "8080" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM docker.io/library/python:3.11-slim AS BUILD | ||
|
||
ARG BRANCH="main" | ||
|
||
RUN set -eux; \ | ||
|
||
apt-get update; \ | ||
apt-get install -y --no-install-recommends git; \ | ||
|
||
python3 -m venv --copies /opt/jinjafx; \ | ||
/opt/jinjafx/bin/python3 -m pip install --upgrade git+https://github.com/cmason3/jinjafx_server.git@${BRANCH} lxml; \ | ||
/opt/jinjafx/bin/python3 -m pip uninstall -y pip | ||
|
||
|
||
FROM scratch | ||
|
||
ENV LD_LIBRARY_PATH=/usr/local/lib | ||
|
||
COPY --from=BUILD /usr/local/lib/python3.11 /usr/local/lib/python3.11 | ||
COPY --from=BUILD /usr/local/lib/libpython3* /usr/local/lib/ | ||
COPY --from=BUILD /lib/x86_64-linux-gnu /lib/x86_64-linux-gnu | ||
COPY --from=BUILD /lib64 /lib64 | ||
COPY --from=BUILD --chown=99:99 /opt/jinjafx /opt/jinjafx | ||
|
||
USER 99:99 | ||
|
||
ENTRYPOINT [ "/opt/jinjafx/bin/python3", "-u", "-m", "jinjafx_server", "-s", "-l", "0.0.0.0", "-p", "8080" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# JinjaFx Server - Jinja2 Templating Tool | ||
# Copyright (c) 2020-2023 Chris Mason <chris@netnix.org> | ||
# | ||
# Permission to use, copy, modify, and distribute this software for any | ||
# purpose with or without fee is hereby granted, provided that the above | ||
# copyright notice and this permission notice appear in all copies. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
||
import sys, jinjafx_server | ||
|
||
sys.argv[0] = 'jinjafx_server' | ||
sys.exit(jinjafx_server.main()) |