add security

feature/reliability_stat
Cizz22 10 months ago
parent 4972734d30
commit 6a6af1678e

@ -34,6 +34,11 @@ ENV POETRY_VIRTUALENVS_IN_PROJECT=1 \
# Copy Poetry installation from builder
COPY --from=builder /app/.venv /app/.venv
# Copy authentication script and entrypoint script
ENV PASSWORD="supersecret"
COPY auth.sh entrypoint.sh /app/
RUN chmod +x /app/auth.sh /app/entrypoint.sh
# Copy application files
COPY . /app/
@ -46,5 +51,5 @@ EXPOSE 3000
# Set the working directory
WORKDIR /app
# Run `make run` as the entry point
CMD ["make", "run"]
# Use our new entrypoint script
CMD ["/app/entrypoint.sh"]

@ -0,0 +1,11 @@
#!/bin/bash
# Use the environment variable for the password
echo -n "Enter password to access container: "
read -s input_password
echo ""
if [ "$input_password" != "$PASSWORD" ]; then
echo "Access denied!"
exit 1
fi
echo "Access granted!"
Loading…
Cancel
Save