diff --git a/Dockerfile b/Dockerfile index a0d69ff..7c92e5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/auth.sh b/auth.sh new file mode 100644 index 0000000..26b2656 --- /dev/null +++ b/auth.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!"