-
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.
Docker image for armv7 architecture (#14)
* test armv7 * test armv7 again * testing old python version * working on new docker containers * trying to build finally * testing installing after workdir * pointed github action to the correct file for frontend * working on conditional logic * new image tag for armv7 * fixed backend dockerfile * fixed backend dockerfile again * changed docker compose --------- Co-authored-by: Max McKelvey <maxmckelvey@Maxs-MBP.positronix.local> Co-authored-by: Max McKelvey <maxmckelvey@Maxs-MacBook-Pro.local>
- Loading branch information
1 parent
2e1a629
commit 2c90ffe
Showing
8 changed files
with
232 additions
and
11 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
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
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,26 @@ | ||
FROM python:3.9-slim-buster | ||
|
||
WORKDIR /app | ||
|
||
# COPY ./requirements.txt /app/requirements.txt | ||
COPY ./pi_requirements.txt /app/requirements.txt | ||
|
||
# RUN pip3 install opencv-python-headless==4.4.0.44 | ||
# RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt | ||
# RUN pip3 install opencv-python-headless=4.4.0.44 | ||
|
||
# RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir opencv-python-headless | ||
# RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir fastapi==0.95.2 | ||
# RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir uvicorn | ||
# RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir pyyaml | ||
# RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir pillow | ||
RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir -r /app/requirements.txt | ||
RUN pip install --no-deps groundlight | ||
RUN pip install --no-deps framegrab | ||
RUN pip install pypylon | ||
|
||
COPY ./api /app/api | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["uvicorn", "api.index:app", "--host", "0.0.0.0", "--port", "8000"] |
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
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,72 @@ | ||
#syntax=docker/dockerfile:1.4 | ||
FROM node:18-buster-slim AS base | ||
|
||
# Install dependencies only when needed | ||
FROM base AS deps | ||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
# RUN apk add --no-cache libc6-compat | ||
# RUN apt install -y libc6-dev | ||
WORKDIR /app | ||
|
||
# Install Extra dependencies | ||
RUN apt-get update || : && apt-get install python3 -y | ||
RUN apt install sudo -y | ||
RUN sudo apt update && sudo apt upgrade -y | ||
RUN sudo apt install make | ||
RUN sudo apt install build-essential -y | ||
RUN sudo apt install libudev-dev | ||
|
||
# Install dependencies based on the preferred package manager | ||
COPY --link package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ | ||
# RUN npm i sharp@0.11.4 | ||
RUN \ | ||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ | ||
elif [ -f package-lock.json ]; then npm ci; \ | ||
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
|
||
# Rebuild the source code only when needed | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps --link /app/node_modules ./node_modules | ||
COPY --link . . | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. | ||
# Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line in case you want to disable telemetry during the build. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN yarn build | ||
|
||
# If using npm comment out above and use below instead | ||
# RUN npm run build | ||
|
||
# Production image, copy all the files and run next | ||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
# Uncomment the following line in case you want to disable telemetry during runtime. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN \ | ||
addgroup --system --gid 1001 nodejs; \ | ||
adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder --link /app/public ./public | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./ | ||
COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
ENV HOSTNAME localhost | ||
|
||
CMD ["node", "server.js"] |
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,13 @@ | ||
fastapi==0.95.2 | ||
uvicorn[standard] | ||
|
||
certifi>=2021.10.8 | ||
frozendict>=2.3.2 | ||
pillow>=9.0.0 # TODO: We may want to mark pillow (and numpy) as extra (https://python-poetry.org/docs/master/pyproject#extras) | ||
pydantic>=1.7.4 | ||
python-dateutil>=2.8.2 | ||
requests>=2.28.2 | ||
urllib3>=1.26.9 | ||
|
||
opencv-python-headless>=4.4.0.44 | ||
pyyaml>=6.0.1 |