Skip to content

Commit

Permalink
Merge pull request #13 from baloise/main
Browse files Browse the repository at this point in the history
Update docker build
  • Loading branch information
robbizbal authored Oct 30, 2024
2 parents c225679 + 174aa3d commit b1ff3b8
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ WORKDIR /app
# set script permissions
RUN chmod +x entrypoint.sh setup.sh

RUN adduser -Ds /bin/bash anon && chown -R anon: /app
USER anon

# run app setup script
RUN "./setup.sh"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install: $(INSTALL_STAMP)

$(INSTALL_STAMP): pyproject.toml
@if [ -z $(POETRY) ]; then echo "Poetry could not be found. Please install it."; exit 2; fi
$(POETRY) install --only main
$(POETRY) install --without dev
touch $(INSTALL_STAMP)

# Clean target to remove temporary files and caches
Expand Down
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

# Your entry point logic here
echo "Running entry point script..."

# Execute the command passed to the container
echo "$(cat banner.txt)"
export PATH="$HOME/.local/bin:$PATH"
make run

if [ -z "$@" ]; then
export PATH="$HOME/.local/bin:$PATH"
make run
fi

# Execute the command passed to the container
exec "$@"
Binary file removed src/static/public/favicon.ico
Binary file not shown.
47 changes: 47 additions & 0 deletions src/static/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/static/scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ document.getElementById('inputForm').addEventListener('submit', function(event)
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ text: inputData }), // Send the input data as JSON
body: JSON.stringify({ text: inputData }), // Send the input text as JSON
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json(); // Parse the JSON response
})
.then(data => {
console.log('Success:', data); // Handle the success response
.then(text => {
// Display the response in the textarea
document.getElementById('responseField').value = JSON.stringify(data, null, 2); // Format the JSON response
document.getElementById('responseField').value = JSON.stringify(text, null, 2); // Format the JSON response
})
.catch((error) => {
console.error('Error:', error); // Handle any errors
Expand Down
2 changes: 1 addition & 1 deletion src/templates/html/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YoYo MaskR</title>
<link rel="icon" type="image/x-icon" href="/static/public/favicon.ico">
<link rel="icon" type="image/svg+xml" href="/static/public/favicon.svg">
</head>
<body>
<h3>Input:</h3>
Expand Down

0 comments on commit b1ff3b8

Please sign in to comment.