-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
27 additions
and
664 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,91 +1,20 @@ | ||
FROM python:3.12.3 as build | ||
FROM python:3.12.3-slim as build | ||
MAINTAINER RAMS Project "code@magfest.org" | ||
LABEL version.sideboard ="1.0" | ||
WORKDIR /app | ||
|
||
# This is actually the least bad way to compose two Dockerfile tech stacks right now. | ||
# The following is copied and pasted from the Node Dockerfile at | ||
# https://github.com/nodejs/docker-node/blob/main/12/buster/Dockerfile | ||
# Update this comment and change the entire copypasta section to upgrade Node version | ||
|
||
######################################### | ||
# START NODEJS DOCKERFILE COPYPASTA # | ||
# https://github.com/nodejs/docker-node # | ||
######################################### | ||
RUN groupadd --gid 1000 node \ | ||
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node | ||
|
||
ENV NODE_VERSION 12.22.3 | ||
|
||
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ | ||
&& case "${dpkgArch##*-}" in \ | ||
amd64) ARCH='x64';; \ | ||
ppc64el) ARCH='ppc64le';; \ | ||
s390x) ARCH='s390x';; \ | ||
arm64) ARCH='arm64';; \ | ||
armhf) ARCH='armv7l';; \ | ||
i386) ARCH='x86';; \ | ||
*) echo "unsupported architecture"; exit 1 ;; \ | ||
esac \ | ||
# gpg keys listed at https://github.com/nodejs/node#release-keys | ||
&& set -ex \ | ||
&& for key in \ | ||
4ED778F539E3634C779C87C6D7062848A1AB005C \ | ||
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ | ||
74F12602B6F1C4E913FAA37AD3A89613643B6201 \ | ||
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ | ||
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ | ||
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ | ||
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ | ||
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ | ||
A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ | ||
108F52B48DB57BB0CC439B2997B01419BD92F80A \ | ||
B9E2F5981AA6E0CD28160D9FF13993A75599653C \ | ||
; do \ | ||
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ | ||
done \ | ||
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ | ||
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ | ||
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ | ||
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ | ||
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ | ||
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ | ||
# smoke tests | ||
&& node --version \ | ||
&& npm --version | ||
|
||
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \ | ||
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ | ||
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ | ||
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ | ||
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \ | ||
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ | ||
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs | ||
################################### | ||
# END NODEJS DOCKERFILE COPYPASTA # | ||
################################### | ||
|
||
# required for python-prctl | ||
RUN apt-get update && apt-get install -y libcap-dev && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install virtualenv \ | ||
&& virtualenv --always-copy /app/env \ | ||
&& /app/env/bin/pip3 install paver | ||
|
||
ADD requirements.txt requirements.txt | ||
ADD test_requirements.txt test_requirements.txt | ||
ADD setup.py setup.py | ||
ADD sideboard/_version.py sideboard/_version.py | ||
ADD pavement.py pavement.py | ||
|
||
RUN /app/env/bin/paver install_deps | ||
ADD . /app/ | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install -r requirements.txt | ||
|
||
FROM build as test | ||
RUN /app/env/bin/pip install mock pytest | ||
CMD /app/env/bin/python3 -m pytest | ||
ADD test_requirements.txt test_requirements.txt | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install -r test_requirements.txt | ||
CMD python -m pytest | ||
ADD . /app/ | ||
|
||
FROM build as release | ||
CMD /app/env/bin/python3 /app/sideboard/run_server.py | ||
EXPOSE 8282 | ||
CMD python /app/sideboard/run_server.py | ||
EXPOSE 80 | ||
ADD . /app/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.