Skip to content

Commit

Permalink
fix(pdf-reader): cleaned up dead code from dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
neilscallywag committed Apr 27, 2024
1 parent 81c9605 commit d9015a3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 40 deletions.
21 changes: 4 additions & 17 deletions backend/simple/fileprocessor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,13 @@ ENV PYTHONPATH /app/:/app/pb/:$PYTHONPATH
COPY src/ /app/
RUN pyinstaller --onefile server.py

FROM debian:stable-slim as final-stage
FROM debian:stable-slim
WORKDIR /app

# Install Python and create a virtual environment
RUN apt-get update && \
apt-get install -y python3-pip python3-venv && \
python3 -m venv /opt/venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Activate virtual environment
ENV PATH="/opt/venv/bin:$PATH"

# Continue with your other setup steps
RUN apt-get update && \
apt-get install -y ocrmypdf && \
apt-get clean && \
apt-get install -y \
ocrmypdf \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY --from=proto-base /bin/grpc_health_probe /bin/grpc_health_probe
COPY --from=builder /app/dist/server server
CMD ["./server"]
# CMD ["tail", "-f", "/dev/null"]
25 changes: 9 additions & 16 deletions backend/simple/fileprocessor/Fileprocessor.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,19 @@ ENV PYTHONPATH /app/:/app/pb/:$PYTHONPATH
COPY src/ /app/
RUN pyinstaller --onefile server.py

FROM debian:stable-slim as final-stage
FROM debian:stable-slim
WORKDIR /app

# Install Python and create a virtual environment
RUN apt-get update && \
apt-get install -y python3-pip python3-venv && \
python3 -m venv /opt/venv && \
apt-get clean && \
apt-get install -y \
ocrmypdf \
curl \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Activate virtual environment
ENV PATH="/opt/venv/bin:$PATH"


# Continue with your other setup steps
RUN apt-get update && \
apt-get install -y ocrmypdf && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download and install the gRPC health probe, used for checking the health of gRPC applications
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \
curl -sLo /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64 && \
chmod +x /bin/grpc_health_probe

COPY --from=proto-base /bin/grpc_health_probe /bin/grpc_health_probe
COPY --from=builder /app/dist/server server
CMD ["./server"]
1 change: 0 additions & 1 deletion backend/simple/fileprocessor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ protobuf
pytest
pytest-mock
nltk
spacy
10 changes: 5 additions & 5 deletions client/src/features/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export const getSavedNotesWithFilter = async (
export const canViewNote = async (
authorization: string,
userId: string,
noteId: string
noteId: string,
) => {
try {
const response = await api.post(
Expand All @@ -452,10 +452,10 @@ export const canViewNote = async (
},
{
headers: {
Authorization: `Bearer ${authorization}`
}
}
)
Authorization: `Bearer ${authorization}`,
},
},
);

return response.data;
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/notes/GeneratedContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import {
import { isFlashcardType } from "~shared/util";

import {
canViewNote,
commitTemporaryContents,
createTemporaryContent,
deleteTemporaryContent,
getTemporaryContents,
getTopics,
updateTemporaryContent,
canViewNote,
} from "~features/api";
import { useAuth } from "~features/auth";

Expand Down

0 comments on commit d9015a3

Please sign in to comment.